How to re-open cell for editing after closing it?

2 posts, 0 answers
  1. Kevin
    Kevin  avatar
    16 posts
    Member since:
    Jun 2012

    Posted 05 May 2017 Link to this post

    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?


  2. Alex Hajigeorgieva
    Alex Hajigeorgieva avatar
    1037 posts

    Posted 09 May 2017 Link to this post

    Hello Kevin,

    If I understand the scenario correctly,  the "service layer result by record ID"  is already saved at the time you wish to open a cell for editing.

    If this is the case, is it possible to save the cell index (row and column) at the same time and retrieve it at that stage when it is needed again? Perhaps in a boolean matrix for quick reference?

    Alex Hajigeorgieva
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top