[英]How to use the Change event on Kendo Hierarchical grid?
I have the Kendo Hierarchical grid as the one on this demo site. 我将Kendo Hierarchical网格作为该演示站点上的网格。 I am trying to call the Change event from the child grid to do some custom action. 我试图从子网格调用Change事件来执行一些自定义操作。 However, the change event never fires. 但是,更改事件永远不会触发。 Please advice. 请指教。
<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>()
.Name("grid_#=EmployeeID#")
.Columns(columns =>
{columns.Bound(o => o.ShipName);})
.DataSource(dataSource => dataSource
...
)
.Events(events => events.Change("change"))
.Pageable()
.Sortable()
.ToClientTemplate()
)
</script>
<script>
function change(e) {
alert('test');
}
</script>
Never mind. 没关系。 I found the answer. 我找到了答案。 I was missing Selectable() on the child grid. 我在子网格上缺少Selectable()。
<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>()
.Name("grid_#=EmployeeID#")
.Columns(columns =>
{
columns.Bound(o => o.OrderID).Width(70);
columns.Bound(o => o.ShipCountry).Width(110);
columns.Bound(o => o.ShipAddress);
columns.Bound(o => o.ShipName).Width(200);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(5)
.Read(read => read.Action("HierarchyBinding_Orders", "Grid", new { employeeID = "#=EmployeeID#" }))
)
.Pageable()
.Sortable()
.Selectable()
.ToClientTemplate()
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.