I tried the following code on the "ActionBegin" event of the child grid. The value displayed on screen; however, the value was not passed back to the controller.if ((args.requestType === "add")) {args.data.ParentId = currentParentId;}
function Begin(args) { if (args.requestType == "beginedit") { var a = args.model.parentDetails.parentKeyFieldValue; // mapping parent key field var b = args.model.parentDetails.parentRowData[args.model.parentDetails.parentPrimaryKeys[0]]; // parent table primary key } } |
function complete(args) { if (args.model.parentDetails.parentKeyFieldValue < 7) {//we can disable the adding checking this contidion var childGridObj = $("#" + this._id).ejGrid("instance"); childGridObj.model.editSettings.allowAdding = false;//disable adding $("#" + this._id + '_add').addClass('e-disable') } else { $("#child1_grid0").ejGrid("option", { editSettings: { allowAdding: true } }); } } |