ej.base.enableRipple(true);
var dataManger = new ej.data.DataManager({
url: 'https://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/Orders',
adaptor: new ej.data.ODataAdaptor(),
crossDomain: true
});
var dataManger2 = new ej.data.DataManager({
url: 'https://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/Customers',
adaptor: new ej.data.ODataAdaptor(),
crossDomain: true
});
var grid = new ej.grids.Grid({
dataSource: window.employeeData,
allowSorting: true,
columns: [
{ field: 'EmployeeID', headerText: 'Employee ID', textAlign: 'Right', width: 125 },
{ field: 'FirstName', headerText: 'Name', width: 125 },
{ field: 'Title', headerText: 'Title', width: 180 },
{ field: 'City', headerText: 'City', width: 110 },
{ field: 'Country', headerText: 'Country', width: 110 }
],
childGrid: {
dataSource: dataManger,
queryString: 'EmployeeID',
allowPaging: true,
columns: [
{ field: 'OrderID', headerText: 'Order ID', textAlign: 'Right', width: 120 },
{ field: 'ShipCity', headerText: 'Ship City', width: 120 },
{ field: 'Freight', headerText: 'Freight', width: 120 },
{ field: 'ShipName', headerText: 'Ship Name', width: 150 },
{ field: 'ShipName', headerText: 'Ship Name', width: 150 },
{ field: 'OrderID', headerText: 'Order ID', textAlign: 'Right', width: 120 },
{ field: 'ShipCity', headerText: 'Ship City', width: 120 },
{ field: 'Freight', headerText: 'Freight', width: 120 },
{ field: 'ShipName', headerText: 'Ship Name', width: 150 },
{ field: 'ShipName', headerText: 'Ship Name', width: 150 },
{ field: 'OrderID', headerText: 'Order ID', textAlign: 'Right', width: 120 },
{ field: 'ShipCity', headerText: 'Ship City', width: 120 },
{ field: 'Freight', headerText: 'Freight', width: 120 },
{ field: 'ShipName', headerText: 'Ship Name', width: 150 },
{ field: 'ShipName', headerText: 'Ship Name', width: 150 },
{ field: 'OrderID', headerText: 'Order ID', textAlign: 'Right', width: 120 },
{ field: 'ShipCity', headerText: 'Ship City', width: 120 },
{ field: 'Freight', headerText: 'Freight', width: 120 },
{ field: 'ShipName', headerText: 'Ship Name', width: 150 },
{ field: 'ShipName', headerText: 'Ship Name', width: 150 },
{ field: 'OrderID', headerText: 'Order ID', textAlign: 'Right', width: 120 },
{ field: 'ShipCity', headerText: 'Ship City', width: 120 },
{ field: 'Freight', headerText: 'Freight', width: 120 },
{ field: 'ShipName', headerText: 'Ship Name', width: 150 },
{ field: 'ShipName', headerText: 'Ship Name', width: 150 },
{
headerText: 'Commands',
width: 120,
commands: [{
buttonOption: {
content: 'Execute',
cssClass: 'e-success',
}
}, {buttonOption: {content: 'Delete', cssClass: 'e-danger'}},
{buttonOption: {content: 'Test Plan', cssClass: 'e-info'}}
]
}
],
childGrid: {
dataSource: dataManger2,
queryString: 'CustomerID',
columns: [
{ field: 'CustomerID', headerText: 'Customer ID', textAlign: 'Right', width: 75 },
{ field: 'Phone', headerText: 'Phone', width: 100 },
{ field: 'Address', headerText: 'Address', width: 120 },
{ field: 'Country', headerText: 'Country', width: 100 }
],
},
},
});
grid.appendTo('#Grid');