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

Temporarily disable edit functionality on a grid

1 Answer 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Benny
Top achievements
Rank 1
Benny asked on 28 Jan 2014, 09:12 PM
Is there a way to temporarily disable the edit functionality on the grid? I tried setting editable to false on a previously editable grid, but it didn't pick up the new configuration change.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 29 Jan 2014, 11:59 AM
Hi Benny,

Disabling the edit functionality of the Grid in its core would require detaching and attaching event handlers, which is cumbersome and requires extensive knowledge of the Grid source code. An easier option is to hide all edit buttons or the command column. For example

$("#grid .k-grid-content .k-button").hide()

$("#grid").data("kendoGrid").hideColumn(4);

In case you are using in-cell editing, your only option is to subscribe to the edit event and execute closeCell in the handler.

http://docs.telerik.com/kendo-ui/getting-started/widgets#example---subscribe-to-an-event-using-the-bind-method

http://docs.telerik.com/kendo-ui/api/web/grid#events-edit

http://docs.telerik.com/kendo-ui/api/web/grid#methods-closeCell

http://docs.telerik.com/kendo-ui/getting-started/widgets#unbinding-kendo-ui-event-handlers

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