|
[index.js]
var grid = new ej.grids.Grid({
dataSource: hierarchyOrderdata,
detailDataBound: detailDataBound,
-----
childGrid: {
dataSource: employeeData,
queryString: "EmployeeID",
toolbar: ["Add", "Edit", "Delete", "Update", "Cancel"],
editSettings: {
allowEditing: true,
allowAdding: true,
allowDeleting: true
},
----
}
});
grid.appendTo("#Grid");
function detailDataBound(args) {
console.log(args);
if (args.data.Verified == false) { // here you can check the parent row value
args.childGrid.editSettings.allowAdding = false; // disable the adding action
}
}
|
|
[index.js]
var grid = new ej.grids.Grid({
dataSource: hierarchyOrderdata,
dataBound: function dataBound(args) {
// ON the internal event of detail-state-change
this.on("detail-state-change", function(args) {
// triggered each time when we collapse and expand the rendered child Grid
console.log(args);
});
},
----
});
grid.appendTo("#Grid");
|