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

prevent selecting non-editable cells

Open rburgstaller opened this issue 5 years ago • 10 comments

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.

rburgstaller avatar Jan 04 '20 14:01 rburgstaller

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

webestet avatar Apr 09 '20 07:04 webestet

I am also keen to see this functionality! Any chance it might be looked at @nstepien ?

sophielevens avatar Jul 01 '20 10:07 sophielevens

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.

SteveDowsett avatar Jul 14 '20 15:07 SteveDowsett

Have the same problem :)

AlexK89 avatar Aug 06 '20 09:08 AlexK89

Have the same problem

matheusroversi avatar Sep 02 '20 13:09 matheusroversi

Same problem here

gernotkogler avatar Dec 06 '20 10:12 gernotkogler

Facing same issue

MadhumatiPathak avatar Oct 20 '21 06:10 MadhumatiPathak

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 ).

kunal886496 avatar Dec 14 '21 09:12 kunal886496