if (args['item'].id === 'ExpandAll') { gridObj.detailRowModule.expandAll(); //works if (gridObj.childGrid != null) { gridObj.childGrid.detailRowModule.expandAll(); // not working.. childGrid.detailRowModule is always null? } }
|
Index.ts
let expandGrandChild = false;
let expandCount = 1;
// Parent toolbar click event handler
toolbarClick: args => {
if (args.item.text === "expandAll") {
expandCount = 1;
expandGrandChild = true;
grid.detailRowModule.expandAll();
}
},
// Child grid dataBound event handler
dataBound: function(args) {
if(expandGrandChild) {
this.detailRowModule.expandAll();
if (expandCount >= this.currentViewData.length) {
expandGrandChild = false;
}
expandCount++;
}
} |