0
我想將一個Kendo UI網格綁定到$scope
上的一個對象,而不是kendo.data.dataSource
。網格顯示數據(位於對象中),但如果我更改數據或添加新行,則更改不會反映在$scope
對象中。這是爲什麼?
我真正的問題是,我想顯示兩個網格頂部&底部,當用戶從頂部網格中選擇一行時,底部網格應該填充細節。但是,這些細節已經被提取並保存在頂部網格的數據源中(因此我沒有底部網格的傳輸部分),因爲我希望能夠保存批次中的任何更改。
這是我如何結合我的網格
頂格
<div kendo-grid="mainGrid"
k-sortable="true"
k-editable="true"
k-selectable="'row'"
k-filterable="true"
k-resizable="true"
k-scrollable='{ "virtual":true }'
k-on-change="selected = dataItem"
k-options="mainGridOptions"
k-height="165">
</div>
底電網
<div kendo-grid="detailGrid"
k-editable="true"
k-selectable="'row'"
k-options="detailGridOptions"
k-data-source="selected.Details"
k-height="125"></div>
這是我如何添加記錄下電網
$scope.detailGrid.dataSource.add();