MVC Kendo网格为数据库事件提供多种功能

时间:2022-03-05 16:50:59

How can I have multiple functions for DataBound in Kendo Grid MVC

如何在Kendo网格MVC中拥有多个DataBound函数

events.DataBound().Events(events => events.DataBound("AdvancedGrid.onDataBound", "alertMe"));

so it will trig both function.

所以这两个函数都是三角函数。

2 个解决方案

#1


1  

Through HtmlHelper you can't add more function to event so I look in DOM object found grid and saw that _events -> dataBound is array, so I added run this

通过HtmlHelper,您不能向事件添加更多的函数,所以我在DOM对象中查找网格,并看到_events -> dataBound是数组,所以我添加了run this。

var grid = $("#MyGrid").data("kendoGrid");
grid.bind("dataBound", alertMe);
grid.dataSource.fetch();

and now my dataBound has 2 events

现在我的数据库有两个事件

MVC Kendo网格为数据库事件提供多种功能

#2


0  

Try this. It works fine for me.

试试这个。对我来说很好。

.Events(ev=>{ev.DataBound(@<text>function(e){ onDataBound(e); alertMe(); }</text>); })

#1


1  

Through HtmlHelper you can't add more function to event so I look in DOM object found grid and saw that _events -> dataBound is array, so I added run this

通过HtmlHelper,您不能向事件添加更多的函数,所以我在DOM对象中查找网格,并看到_events -> dataBound是数组,所以我添加了run this。

var grid = $("#MyGrid").data("kendoGrid");
grid.bind("dataBound", alertMe);
grid.dataSource.fetch();

and now my dataBound has 2 events

现在我的数据库有两个事件

MVC Kendo网格为数据库事件提供多种功能

#2


0  

Try this. It works fine for me.

试试这个。对我来说很好。

.Events(ev=>{ev.DataBound(@<text>function(e){ onDataBound(e); alertMe(); }</text>); })