Hi Michael,
Thanks for contacting Syncfusion support.
We created a sample in javascript and in this sample we have two syncfusion grid as Master/Detail relationship. In Master Grid we bind the rowSelected event of ejGrid and this event will be triggered after the row is selected. In this event we able to get row data in the arguments and using ej.DataManager we able to filter data according to the employeeID field. The filtered data has been bound to the detail grid using dataSource method.
We did not face any issue at our end while updating the dataSource for the Detail Grid.
Find the code example and sample:
$("#MasterGrid").ejGrid({
// the datasource "window.employeeData" is referred from templatelocaldata.js
dataSource: ej.DataManager(window.employeeData).executeLocal(ej.Query().take(5)),
columns: [
-------------------------------
],
rowSelected: function (args) {
var employeeID = args.data.EmployeeID;
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)));
},
});
$("#DetailGrid").ejGrid({
dataSource: null,
// the datasource "window.gridData" is referred from jsondata.min.js
dataSource: ej.DataManager(window.gridData).executeLocal(ej.Query().take(10)),
allowPaging: false,
columns: [
--------------------------
]
}); |
Sample: http://www.syncfusion.com/downloads/support/forum/126186/ze/Html_Encode_Feature1778306732
In the provided code example, we found that you have bound the array of string array to the Detail Grid.
gobj.dataSource([["JNJ","Johnson & Johnson","29-Apr-2016",2000," $110.75"," $221,500.00"],["V","Visa"," 1-Apr
--------------------------"]])
|
For the Grid we have to bound the array of JSON object.
"[{"OrderID":10258,"CustomerID":"ERNSH",ShipRegion":null,"ShipPostalCode":"8010",07-31T18:30:00.000Z -------}]"
|
So, we suspect that it may be the root cause of the issue that the detail grid is filled with empty data.
We also found that you have used refreshContent method to refresh the grid content.The dataSource method of ejGrid is used to refresh the grid with new dataSource. So, the refreshContent method is not required to refresh the grid.
If you still face any issues, please share the following details
1. Did you face any console error in the sample? If yes, provide the stackrace of an issue.
2. Provide the complete code snippetof master and detail grid rendering
3. If possible, replicate the issue in the attached sample.
4. Essential Studio Version details.
Regards,
Prasanna Kumar N.S.V