How to find the rowNumbers when we work with ReactTable

595 views Asked by At

In ReactTable how to find the row numbers, when ReactTable is used along showPageSizeOptions={true}

as user Can change the rows dynamically any method to find the user selected rows which helps me in adding new Entiers if user wish at perticular page and index.

2

There are 2 answers

0
toki On

Rows have an index property.

The index of the original row in the data array that was passed to useTable. If this row is a subRow, it is the original index within the parent row's subRows array.

I'm not entirely sure what to make of the rest of your question, but hopefully this is a start. The index will always be based on the original data array passed, so if users are able to move and adjust rows, you may have to implement additional logic, as react-table does not currently expose the current row number.

0
Mohan S On

We can use onPageSizeChange which results two parameters first says about rows changed to and second tells about the current page number (inbuilt React tables functionality) and onPageChange functionality toget the current page number. Note:Page number index starts from 0