react-data-grid
react-data-grid copied to clipboard
prevent selecting non-editable cells
Which version of React JS are you using?
☣️ Not officially supported, expect warnings and errors ☣️
- [x] v16.x.x
Which browser are you using?
✅ Officially supported ✅
- [ ] IE 9 / IE 10 / IE 11
- [ ] Edge
- [x] Chrome
I'm submitting a ...
- [ ] 🐛 Bug Report
- [x] 💡 Feature Request
Issue Details
- What the current behavior is
currently all cells can be selected / focused
- What the desired behavior is
I would like to disable selecting specific cells. At the very minimum I would like the tab navigation to only include editable cells.
Lets assume that I have a table with 3 rows and 3 columns, the first column should not be editable / locked. Therefore you start in the 2nd column of the 1st row. Now you press tab, you get to the 3rd column, now you press tab again and you should be in the 2nd row/2nd column (skipping over the 1st column of the 2nd row).
- (If Feature) The motivation / use case for the feature
I would like to replicate the behaviour of locked cells in excel.
Yes. +1. I want to have this functionality too. It's problem now for my app.
This issue needs to comments from author of library. @nstepien
I am also keen to see this functionality! Any chance it might be looked at @nstepien ?
another +1 here, this is causing me no end of problems. if a cell is selected regardless of whether its editable or not, it makes it very hard for the user to know which fields are actually editable and that they can just start typing in.
Have the same problem :)
Have the same problem
Same problem here
Facing same issue
There is another way round:
onSelectedCellChange={(selectedCellInfo)=>{ // selectedCellInfo structure recieved from react-data-grid is { idx, rowIdx} where idx is column index if( selectedCellInfo.idx === columnIndexYouWantToSkip ) dataGridRef.current.selectCell({ idx: desiredColumnIndex, rowIdx: desiredRowIndex}, false) }}
This is for all the cells in a column. You can maybe, approach your problem using "onSelectedCellChange" and some code being a Super set of above ( if that helps ).