Events 将单击事件绑定到剑道UI按钮

Events 将单击事件绑定到剑道UI按钮,events,kendo-ui,Events,Kendo Ui,我正在使用一个按钮删除所有 我为工具栏写了这篇文章: toolbar:["create", { name: "delete-all", text: "Delete All" }] 它运行良好,并在剑道网格中添加了一个按钮。但是现在我想把点击事件添加到这个按钮上 单击此按钮时,我想显示一个警报(如hi) 怎样才能做到呢 谢谢。我的网格 $("#grid").kendoGrid({ dataSource: dataSource,

我正在使用一个按钮
删除所有

我为
工具栏
写了这篇文章:

toolbar:["create", { name: "delete-all", text: "Delete All" }]
它运行良好,并在剑道网格中添加了一个按钮。但是现在我想把点击事件添加到这个按钮上

单击此按钮时,我想显示一个警报(如
hi

怎样才能做到呢

谢谢。

我的网格

  $("#grid").kendoGrid({
                dataSource: dataSource,
                navigatable: true,
                pageable: true,
                height: 430,
                toolbar: ["Edit"],
                columns: [
                            "ProductName",
                            { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: 110 },
                            { field: "UnitsInStock", title: "Units In Stock", width: 110 },
                            { field: "Discontinued", width: 110 },
                            { command: "destroy", title: " ", width: 90}],
                editable: false
            });
我的编辑按钮事件

  $('.k-grid-Edit').on("click", function () {

                alert('hi');

            });
剑道网格工具栏中创建
按钮
剑道动态生成
按钮类

我的网格中有编辑按钮,因此其类为
k-grid-edit

初始化网格后,添加以下代码:

$('.k-grid-delete-all').on("click", function () {
    alert('hi');
});
基本上,您需要定义一个处理程序,使用CSS类作为选择器,该类是连接
.k-grid-
工具栏中
按钮的
名称的结果