Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to cancel edit on Kendo Grid?

In my kendo grid, I have a situation where, when they click on a cell, it will be in edit mode. But depending on a condition, I need to cancel the edit.

I tried using the code to simulate the escape key press in jQuery but that didnt work.

like image 782
sony Avatar asked Dec 26 '22 02:12

sony


1 Answers

You can use

 $('#grid').data("kendoGrid").closeCell();

on your event or you can put this in your edit event itself like:-

if($(e.container).index()==1)
         $('#list').data("kendoGrid").closeCell();

for reference you can see this JSfiddle example here i am using this code for second column,if you will click on second column of the grid then it will close the cell.

JSfiddle link:-http://jsfiddle.net/Eh8GL/250/

like image 102
Devendra Soni Avatar answered Jan 06 '23 21:01

Devendra Soni