BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
<script type="text/javascript"> var data = [ { OrderID: 1, EmployeeName: 'James', Details: [{ "CustomerName": "Sam", CustomerID: 1 }, { "CustomerName": "Nancy", CustomerID: 2 }] }, . . . ] $(function () { $("#Grid").ejGrid({ dataSource: data, . . . . detailsExpand: expandDetails, childGrid: { dataSource: [], queryString: "EmployeeID", allowPaging: true, create: 'childCreate', . . . . }, });
}); //detail expand event of the parent grid function expandDetails(args) { window.childData = args.masterData.Details; //get the inner array object and store in a variable }
//create event of the childgrid function childCreate(args) { this.dataSource(window.childData); //assigning the child grid dataSource using the dataSource method of the grid }
|
$(function () { $("#Grid").ejGrid({ dataSource: data, allowSorting: true, columns: [ …. ], detailsExpand: expandDetails, childGrid: { dataSource: [], queryString: "EmployeeID", allowPaging: true, create: 'childCreate', columns: [ ….
] },
});
}); function expandDetails(args) { window.childData = args.masterData.Details; if (window.childData.length == 0) { args.cancel = true; args.detailsRow.hide(); if ($(args.masterRow.context).hasClass("e-icon")) args.masterRow.context.remove(); } } ….
|