Getting row index in dataFormat props function ?
See original GitHub issueI can see dataFormat props func expsoses cell and complete row object.
dataFormat(cell,row) {}
Is there any way to get row index here ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Columns Props · react-bootstrap-table2
Specify the data type on column. Available value so far is string , number , bool and date . Default is string ....
Read more >How can I get row index if every cell is a child component?
I am currently trying to create a table where row index needs to be displayed for every row. I thought this was a...
Read more >General Props | Docs and API Reference - React Data Grid
The value of the activeCell should be an array of length 2 , the first value being the row index, while the second...
Read more >Table Visualization — pandas 1.5.2 documentation - PyData |
Hiding Data#. The index and column headers can be completely hidden, as well subselecting rows or columns that one wishes to exclude. Both...
Read more >Table Options - Bootstrap Table
See column properties for more details. ... Default: function(index, row, element) { return '' } ... To get loading errors please use onLoadError ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is gold. Thanks @AllenFang
@AllenFang , if the filter of the column is applied, and any filter is made, the row-id will not start with number “1” because the “ID” here is generated based on the product number. For e.g, if we filter the column “name” with value 4, the row id will will show “4”. Since the ID is generated incremental, thus cannot deal with it.
Goal: Want to to have row_index for id add incremental, and even after filter the column name, the 1st row index will start/count as no.1.
Question: If pagination is applied, the row index will always start with number 1, when we turn to page 2, or page 3. if we used own generated row index as below code, how can we fix that ?
For example code below, try to use this:
indexNumber(cell, row, enumObject, rowIndex) { return (<div>{rowIndex + 1}</div>) }
<TableHeaderColumn ref='id' dataField="id" width='70px' dataSort expandable={false} dataFormat={this.indexNumber} > ID </TableHeaderColumn>