I am using in-cell editing in the Kendo grid. I need to call the service layer for each record to determine whether it is editable. Therefore when the change event is received, I call the service layer for the selected records(). When the service layer result arrives, if it indicates not editable then I use grid.closeCell to prevent editing. When the edit event is received, I check if the previously received result indicates not editable, and if so then I use grid.closeCell to close the cell. (I am saving the service layer result by record ID so that I only need to call the service the first time a row is clicked.)
However I have a synchronization problem. The first time a row is clicked, the cell opens for editing, because the service layer result has not been received yet. If the row is not editable, then the cell closes when the service result is received. This is not good, as the user might think the cell is editable and start to edit the cell before it closes.
I would like to prevent the cell from opening in edit mode when it is clicked the first time, but I'm not sure how to do this. I tried modifying the change event actions by calling grid.closeCell before making the service layer call, but I'm not sure how to open the cell back up when I get back a result indicating that the row is editable. I thought I could use editCell, but that requires the jQuery of the cell. Since I get the result back under the change event, how do I know at that point which cell was clicked?