假设我有以下内容:
var data = {
identifier: "pkid",
items: [ {pkid: 3456, name: "Tom", kids: [ {pkid: 3459, kidname: "Jenny"}, {pkid: 45698, kidname: "Jimmy"} ]
}
var mainStore = new ItemFileWriteStore({data: data});
var mainGrid = new var grid = new dojox.grid.DataGrid({
id: 'grid',
store: store,
structure: layout,
rowSelector: '20px'},
document.createElement('div'));
/*append the new grid to the div*/
dojo.byId("maingridDiv").appendChild(grid.domNode);
/*Call startup() to render the grid*/
grid.startup();
如何从数据存储中删除pkid:45698识别的孩子,如果它显示那个孩子,它应该反映在网格中,不应再显示了?
答案 0 :(得分:0)
基本上,你只需要var kids = store.getValues(parent,“kids”); 然后你需要确定你想要的孩子在哪个索引,然后是store.setValues(parent,“kids”,kids.splice(indexOfKid,1)); 类似的东西。