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

[Solved] Disable specific cell without closeCell() (to keep event listeners intact)

1 Answer 639 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 11 Nov 2014, 08:06 PM
Hi, I'm able to "disable" cells using the method I've found recommended in the forums, which is the grid's closeCell() method. However, I have event listeners on elements in the cells (specifically Twitter Bootstrap popovers, although those can be switched with Kendo tooltips if that makes this easier), which are removed when the cell enters and leaves editing mode (even when it is imperceptible as when immediately calling closeCell()), presumably because the content is removed from the DOM and then reinserted from the template). To avoid having to rebind the listeners on every click of the cell, is there any way to stop the cell from going into edit mode in the first place?

Thanks

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 13 Nov 2014, 12:59 PM
Hello Dean,

The closeCell() method is the one that the Kendo UI Grid will call itself when editing is moved to another cell. So there is no other way to close the cell for editing. The edit event that is fired when the cell goes into edit mode cannot be prevented.

As for the events fired  - when method like closeCell() is called no event will be fired, however this is a general programming practice not to fire events when methods are called as the programmer will already know that this action happens. If you insist on firing the event, you can manually trigger it like this:

$('#grid').getKendoGrid().trigger('cancel')

Regards,
Kiril Nikolov
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
Dean
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or