Kei*_*ith 4 jquery kendo-ui kendo-grid
我已经看到了如何在一个kendo网格中使列可编辑/不可编辑,但是如何通过网格外的按钮使某个列可编辑?
网格开始时不可编辑,但是当在网格外单击按钮时,将使"第2列"可编辑.可以这样做吗?
<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" }
]
})
Run Code Online (Sandbox Code Playgroud)
使用Grid的setOptions方法在外部按钮单击上启用编辑:
$("#Grid-ID").data("kendoGrid").setOptions({ editable: true });
Run Code Online (Sandbox Code Playgroud)
这将使所有绑定列都可编辑,除非您通过schema.model.fields配置禁用了对特定字段的编辑,如Grid Batch Editing示例中所示.
SomeFieldName: { editable: false }
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2860 次 |
| 最近记录: |