<script type="text/javascript"> $(function () { //Getting the datasource of the Notes grid(Details grid) at initial var data = $('#<%= NotesGrid.ClientID %>').ejGrid("model").dataSource; $('#<%= FlatGrid.ClientID %>').ejGrid({ selectedRowIndex: 0, rowSelected: function (args) { var employeeId = args.data.EmployeeID; var gridObj = $('#<%= NotesGrid.ClientID %>').ejGrid("instance"); var detaildata = ej.DataManager(data).executeLocal(ej.Query().where("EmployeeID", ej.FilterOperators.equal, employeeId, false).take(10)); gridObj.dataSource(ej.DataManager(detaildata.slice(0, 5))); } }); }); |