4
votes

I've seen how you can make a column editable / non-editable within a kendo grid, but how do I make a certain column editable from a button outside the grid?

The grid starts off as not editable but when a button is clicked outside the grid, it is to make "Column 2" editable. Can this be done?

<button id="Edit">Edit</button>
<div id="grid"></div>

$('#grid").kendoGrid({
    pageable: true,
    editable: false,
    etc...
    columns: [
       { field: "Column 1", title: "Column 1" }
       { field: "Column 2", title: "Column 2" }
       { field: "Column 3", title: "Column 3" }
    ]
})
1

1 Answers

5
votes

Use the Grid's setOptions method to enable editing on external button click:

$("#Grid-ID").data("kendoGrid").setOptions({ editable: true });

This will make all bound columns editable, unless you have disabled editing for specific fields via the schema.model.fields configuration, as shown in the Grid Batch Editing example.

SomeFieldName: { editable: false }