Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
Cell Edit Editable Per Row
posted

Hello, I am using a grid with cell edit and it is common for each cell to have its own determination of if it is editable. So not only per column, but based on other data in the row. This is mostly fine, as I use a function bound to [editable] which tracks the current row in order to not only decide if the column as a whole is editable, but if the specific cell in that column is based on the row. This becomes an issue when the very last editable column affects this dynamic editability.

In the below example, the cells in green are editable, in red are not, and that is determined by that Locked checkbox, which is always editable. Locked also happens to be the last editable column in the row, and so in edit mode, if you were to check the box and hit tab, the grid immediately determines that all those cells before in that row are uneditable (which is true for that row) before it moves to the next row and thus it will skip focus to the Locked column of the next row.

I looked at the source code and it appears that the tab listener where it calls getNextCell will run the code for determining editable columns (using whatever is bound to [editable]) before it runs endCellEdit or beginCellEdit on the cells you are leaving/going to. This means that logic is called on the row you are on, not the row you are going to. By the time BeginCellEdit of the next row runs, it has already decided that the Locked column is the first editable column, despite the fact that if it ran that logic again, previous columns should now be editable.

I have tried many ways around this and cannot think of anything that wouldn't be a terrible hack. Am I missing some other way to do this?