剑道网格栏:如何在页脚模板中绑定点击事件数据? [英] kendo grid column: how to data bind click event in footer template?
问题描述
请参阅示例 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屋!