剑道网格栏:如何在页脚模板中绑定点击事件数据? [英] kendo grid column: how to data bind click event in footer template?

查看:150
本文介绍了剑道网格栏:如何在页脚模板中绑定点击事件数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在页脚模板中,Kendo Grid列的数据绑定单击事件不起作用。



请参阅示例 http://dojo.telerik .com / ALAZo



价格的列模板上的点击事件工作正常,但不支持页脚模板。



任何使用MVVM绑定的解决方案都将不胜感激

解决方案

默认情况下,网格的页脚不绑定到ViewModel。解决方法是在网格初始化后使用合适的jQuery选择器查找页脚,然后手动绑定它。所以像这样:

  kendo.bind($(body),viewModel); 
kendo.bind($(#grid)。find(。k-grid-footer),viewModel);

在这里,我已经为您的网格声明添加了id =grid,以便找到它:

 < div id =griddata-role =griddata-bind =source:dataSource


Kendo Grid columns' data-bind click event in the footer template is not working.

Please see the example http://dojo.telerik.com/ALAZo

The click event on column template for price is working fine but not for the footer template for the same.

Any resolution which uses MVVM binding would be greatly appreciated

解决方案

By default, the header and footer of the Grid are not bound to the ViewModel. A workaround is to find the footer with an appropriate jquery selector after the grid has been initialised and then bind it manually. So something like this:

kendo.bind($("body"), viewModel);
kendo.bind($("#grid").find(".k-grid-footer"), viewModel);

Here I've added id="grid" to your grid declaration like so in order to find it:

<div id="grid" data-role="grid" data-bind="source:dataSource"

这篇关于剑道网格栏:如何在页脚模板中绑定点击事件数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆