How to prevent cell go to editor mode when click readonly column

Tags: #<Tag:0x00007efc64eb2f78> #<Tag:0x00007efc64eb2e38>

Hello. I’m trying to do read only column and disable selection for the read only column. (I use event.stopImmediatePropagation() if the column is readonly inside beforeOnCellMouseDown)
It works perfectly fine. But I have one problem. When I double click on readonly cell, the selected cell that isn’t readonly go to editor mode. How to prevent that ?

Here’s jsfiddle (in the jsfiddle example, I assume column index 0 is read only column)
https://jsfiddle.net/cfawthL6/

Step to reproduce is, you select any cell that isn’t in first column(which it’s read only column) then double click readonly cell inside first column, the selected cell go to edit mode. What I expect is it shouldn’t go to edit mode except user double click the selected itself.

Thank you :pray:

Hi @elecwebmaker

There is an option that will make implementing this requirement a lot easier. You can use disableVisualSelection option on the readOnly column, and it will handle it properly.

Here’s an example: https://jsfiddle.net/handsoncode/x451bfa7/

@adrian.szymanski Yes, we also have tried this way. But our requirement is we need keep selected cell same as previous if user try to click read only cell.

@elecwebmaker

I see. In this situation it would be very tricky to achieve, if even possible at all.

The reason for this is that if cell is selected it means that the focus is still on it, so the mouse and key events are caught by its focus manager and in result you can still access the editor with double click, or the ENTER key.

I can suggest to try with beforeOnCellMouse hook and then updating the settings based on the selected columns range to manage the editor state within cells function.

@adrian.szymanski Thank you. It seems it’s tricky to achieve as you mentioned. So we keep it as this way for now.

@elecwebmaker

Ok, thank you for letting me know. I will close this topic now, but if you need help with anything else, feel free to open a new one.