Hi Manolo,
Thanks for contacting Syncfusion support.
As we have rendered the detail grid based on the row data of the selected row. So, we can get the relational value and set it when adding a new record to the detail grid using the actionBegin event of the Grid.
Please refer to the below code example.
rowSelected: function (args) {//rowSelected event of master grid
employeeID = args.data.EmployeeID;//get the primary key value of master grid
var detaildata = ej.DataManager(window.gridData).executeLocal(ej.Query().where("EmployeeID", ej.FilterOperators.equal, employeeID, false).take(10));
var gridObj = $("#DetailGrid").ejGrid("instance");
gridObj.dataSource(ej.DataManager(detaildata.slice(0, 5)));
},
//actionBegin event of detail grid
actionBegin: function (args) {
if (args.requestType == "save") {
alert(args.data.EmployeeID);
}
else if (args.requestType == "add") {
args.data["EmployeeID"] = employeeID;//assign the column value with the primary key value of master grid
}
}, |
Regards,
Ragavee U S.