This is a migrated thread and some comments may be shown as answers.

Is there any way to know grid edit mode changes

3 Answers 216 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vinay
Top achievements
Rank 2
Vinay asked on 19 Feb 2014, 07:58 AM
Hi,

I have a kendo grid with configuration as editable='inline' or editable='incell'.
In the case of incell editing,
- when I click in a cell, cell immediately move to edit mode.
- Now I click on another cell then the previous selected cell which is in edit mode move back to read-only state.\
In the case of inline editing,
- when I click on edit button, cell immediately move to edit mode and two buttons update and cancel created by grid.
- Now when I clicked on update or cancel, respective callback handler called and grid cell moved to read-only state.

I just want to know is there any way (may be some event) through which I can detect that grid changes its mode from edit to read-only(required for incell editing).


Thanks,
Vinay

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 19 Feb 2014, 09:41 AM
Hello Vinay,


If there are any changes made to the currently edited item, the Grid will fire the save event (update button should be clicked in Inline and PopUp edit modes), when the item is saved. There is also a cancel event, which is fired when the cancel button is clicked (it is not fired in InCell edit mode).

Please let me know if this information was helpful or I could provide you further assistance on this topic.

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Vinay
Top achievements
Rank 2
answered on 19 Feb 2014, 10:04 AM
Hi Dimiter,

It is ok for inline edit because we have update, cancel button.
I'm facing issue for incell editing and I want to detect grid mode state[edit or read-only].

Thanks,
Vinay
0
Dimiter Madjarov
Telerik team
answered on 20 Feb 2014, 12:16 PM
Hello Vinay,


The only built in event that is fired in this case would be the save event (when there are changes made). By design no event is fired when the user did not change the model, so if you would like to capture the exact moment, when he leaves the cell, you should implement some custom solution. For example you could use the edit event of the Grid, which is fired when the Grid enters edit mode, access the current cell via the passed e.container parameter and bind to the blur event of the editor input.
E.g.
function edit(e) {
    e.container.find("input").blur(function () {
        alert("Exiting cell");
    });
}


Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Vinay
Top achievements
Rank 2
Answers by
Dimiter Madjarov
Telerik team
Vinay
Top achievements
Rank 2
Share this question
or