nas*_*ski 2 jquery kendo-ui kendo-grid
这可能吗?现在我有:
kendoGrid = gridObj.kendoGrid({
dataSource: gridDataSource,
editable: "popup",
});
Run Code Online (Sandbox Code Playgroud)
哪个效果很好,但我希望编辑内联,只在弹出窗口中添加行,这可能吗?
哎呀,这有点棘手.我要做的是inline默认将网格定义为可编辑,然后定义我自己的创建按钮,在我的自定义创建按钮的处理程序中我暂时将editable模式更改为popup然后(一旦弹出窗口打开)将其还原为inline.就像是:
var grid = $("#grid").kendoGrid({
dataSource: ds,
toolbar: [
{
// My own version of "Add new record" button, with name **popup**
text : "Add new record",
name: "popup",
iconClass: "k-icon k-add"
}
],
// By default is **inline**
editable: "inline",
...
}).data("kendoGrid");
// Event handler for my **popup** button defined in the grid toolbar
$(".k-grid-popup", grid.element).on("click", function () {
// Temporarily set editable to "popup"
grid.options.editable = "popup";
// Insert row
grid.addRow();
// Revert editable to inline
grid.options.editable = "inline";
});
Run Code Online (Sandbox Code Playgroud)
你可以在这里看到它:http://jsfiddle.net/OnaBai/7nj0pxwz/
| 归档时间: |
|
| 查看次数: |
3587 次 |
| 最近记录: |