在Kendo UI的网格触发事件中执行默认命令吗?(Do default commands in Kendo UI's grid trigger events?)
我在网格中有一个标准的删除命令按钮。
我想订阅活动点击进行一些检查。
我可以这样做吗? 或者我是否必须创建自定义命令?
I have a standard delete command button in a grid.
I would like to subscribe to the event click for some check.
Can I do this? Or do I have to create a custom command?
最满意答案
标准删除命令会触发remove事件 ,因此您可以绑定到该事件 :
grid.bind("remove", function (e) { if (e.model.text === "Item 1") { console.log("well, I'm doing something else for you"); } });如果你想要自定义行为(例如创建一些逻辑来决定是否允许这种删除),那么你可能必须创建一个自定义命令(你可以根据需要以相同的方式设置它)。
The standard delete command triggers the remove event, so you can bind to that:
grid.bind("remove", function (e) { if (e.model.text === "Item 1") { console.log("well, I'm doing something else for you"); } });If you want custom behavior (e.g. create some logic to decide whether you want to allow this delete), then you'll probably have to create a custom command (you can style it in the same way if you want).
更多推荐
发布评论