【发布时间】:2017-10-20 16:12:05
【问题描述】:
我正在使用一个自动定义数据源并为每个项目加载子网格的网格。
这个标记相当简单
<div class="thegrid"
kendo-grid
k-data-source="vm.GeneralData"
k-options="vm.gridMainOptions">
<div k-detail-template>
<div kendo-grid k-options="vm.detailGridOptions(dataItem)"></div>
</div>
</div>
在子网格详细信息模板中,我有一个网格列触发事件以响应ng-click 事件。
columns: [
{
field: "Id",
editable: false,
hidden: true
},
{
title: "",
width: "160px",
editable: false,
template:
"<span class='glyphicon glyphicon-remove remove-template'
ng-click='vm.removeItem(dataItem)'></span><",
attributes: {
"class": "managing-templates-column",
"title": "Delete This Template"
}
]
在控制器本身中,我有一个对此做出响应的方法。
function removeItem(dataItem) {
console.log("remove", dataItem);
//removed code that makes an ajax call to actually delete item
//... and now need to refesh that datasource that this belongs to.
}
如何获取dataItem 的数据源以便刷新它?
【问题讨论】:
标签: javascript angularjs kendo-ui kendo-grid