<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server"> <style> .e-grid .e-gdiagonalnext:before { content: "\e675" !important; } .e-grid .e-gnextforward:before { content: "\e676" !important; } </style> <div> <ej:Grid ID="Grid" runat="server" DetailsTemplate="#tabGridContents" AllowPaging="true"> <ClientSideEvents DetailsDataBound="detailGridData" /> </ej:Grid> <script src="Scripts/jsondata.js"></script> <script id="tabGridContents" type="text/x-jsrender"> <div class="tabcontrol"> <div id="detailGrid"></div> </div> </script> <script type="text/javascript"> function detailGridData(e) { var filteredData = e.data["EmployeeID"]; // the datasource "window.ordersView" is referred from jsondata.min.js var data = ej.DataManager(window.ordersView).executeLocal(ej.Query().where("EmployeeID", "equal", parseInt(filteredData), true)); e.detailsElement.find("#detailGrid").ejGrid({ dataSource: data, . . . . . . . . }); . . . . } </script> |
<ej:Grid ID="EmployeesGrid" runat="server" DetailsTemplate="#GridContents"> <ClientSideEvents DetailsDataBound="detailGridData" /> . . . .. . . . </ej:Grid> <script src="Scripts/jsondata.min.js"></script> <script id="GridContents" type="text/x-jsrender"> <div id="gridTab{{:EmployeeID}}"> <div id="detailGrid{{:EmployeeID}}"></div> </div> </script> <script type="text/javascript"> function detailGridData(e) { var filteredData = e.data["EmployeeID"]; // the datasource "window.ordersView" is referred from jsondata.min.js var data = ej.DataManager(window.ordersView).executeLocal(ej.Query().where("EmployeeID", "equal", parseInt(filteredData), true)); e.detailsElement.find("#detailGrid" + filteredData).ejGrid({ dataSource: data, editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true }, toolbarSettings: { showToolbar: true, toolbarItems: [ ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Delete, ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel ] }, . . . .. .. }); } |