在Kendo UI的网格触发事件中执行默认命令吗?(Do default commands in Kendo UI's grid trigger events?)

编程入门 行业动态 更新时间:2024-10-27 12:35:36
在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).

更多推荐

本文发布于:2023-08-04 23:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1423100.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网格   命令   事件中   UI   Kendo

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!