1

我已经使用骨干收集和剑道网格加载了一些数据。我添加了一个自定义更新命令并分配了一个事件,但它甚至没有触发。请帮忙。

$("#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");
}
4

1 回答 1

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");
}
于 2012-12-24T10:56:03.757 回答