react-data-grid icon indicating copy to clipboard operation
react-data-grid copied to clipboard

no way to find the selected row after filtering the grid

Open bhaskarsunil opened this issue 9 years ago • 3 comments

grid not returning the right row when i use the onCellSelected event, it only happens when i have filtered the rows before onCellSelected event.

i am doing something like this:

var x = this.state.rows[rowIdx].rowId

the above command returns the wrong row, this only happens when i have previously filtered the rows, i know the reason, its happening because here the the.state.rows contains all the rows of the grid, and the rowIdx if 0 returns the first row of all the rows of the grid. just want to know how can we get the rowset of the filtered rows, so that i can directly apply the rowIndex on that and can find the right row, is that already possible or its just a bug which is gonna take time to resolve, is there any way around.

  • Thanks!

Which version of React JS are you using?

✅ Officially supported ✅

  • [ ] v15.4.x

⚠️ Not officially supported, expect warnings ⚠️

  • [ ] v15.5.x

☣️ Not officially supported, expect warnings and errors ☣️

  • [ ] v16.x.x

Which browser are you using?

✅ Officially supported ✅

  • [ ] IE 9 / IE 10 / IE 11
  • [ ] Edge
  • [ ] Chrome

⚠️ Not officially supported, but "should work" ⚠️

  • [ ] Firefox
  • [ ] Safari

I'm submitting a ...

  • [ ] 🐛 Bug Report
  • [ ] 💡 Feature Request

👋 Need general support? Not sure about how to use React itself, or how to get started with the Grid? Please do not submit support request here. Instead see

https://github.com/adazzle/react-data-grid/blob/master/CONTRIBUTING.md


Issue Details

Please include:
- What the current behavior is
- What the desired behvaior is
- (If Bug) Steps to reproduce the issue
- (If Feature) The motivation / use case for the feature

We especially love screenshots / videos of problems, and remember
The Best Issue Is A Pull Request™

bhaskarsunil avatar Aug 28 '17 16:08 bhaskarsunil

@bhaskarsunil I'm facing the same issue, did you ever find a fix for that?

ragzor avatar Jan 10 '18 13:01 ragzor

@bhaskarsunil @ragzor I'm having the same issue I think, where I select a row, and then sort by asc/desc, the selected row index stays where it is (IE, the x'th row stays highlighted instead of the new row being highlighted. If anyone fixes this post here

JordanKadish avatar Apr 10 '18 18:04 JordanKadish

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please reopen this if you feel it has been incorrectly closed and we will do our best to look into it. Thank you for your contributions.

stale[bot] avatar Jul 12 '18 11:07 stale[bot]