我使用主干收集和kendo网格加载了一些数据。我添加了一个自定义更新命令并分配了一个事件,但偶数不会触发。请帮忙。
$("#grid").kendoGrid({
editable: true,
batch: true,
columns: ["Name", "Description", "Date", { command: { text: "Update Me", name:"Update", click: onEdit }, title: " ", width: "140px"}],
dataSource: {
schema: {
model: docWrapper
},
data: new documentlistWrapper((window.docs))
},
pageSize:5
});
}
});
function onEdit(e)
{
alert("hello");
}
答案 0 :(得分:3)
您的大括号({}
)未正确平衡。试试这个:
$("#grid").kendoGrid({
editable : true,
batch : true,
columns : ["Name", "Description", "Date", { command: { text: "Update Me", name: "Update", click: onEdit }, title: " ", width: "140px"}],
dataSource: {
schema: {
model: docWrapper
},
data : new documentlistWrapper((window.docs))
},
pageSize : 5
});
function onEdit(e) {
alert("hello");
}