var treeGridObj = new ej.treegrid.TreeGrid({
dataSource: window.stackedData,
allowPaging: true,
childMapping: 'subtasks',
treeColumnIndex: 1,
pageSettings: { pageCount: 5 },
columns: [
{ headerText:'Orders',textAlign:'Left',
columns:[
{ headerText: 'Order Details', textAlign: 'Center',
columns: [
{ field: 'orderID', headerText: 'Order ID', textAlign: 'Right', width: 90 },
{ field: 'orderName', headerText: 'Order Name', textAlign: 'Left', width: 170 },
]
},
{
headerText: 'Shipment Details', textAlign: 'Center', columns: [
{ field: 'shipMentCategory', headerText: 'Shipment Category', textAlign: 'Left', width: 150 },
{ field: 'shippedDate', headerText: 'Shipped Date', textAlign: 'Right', width: 120, format: 'yMd' },
{ field: 'units', headerText: 'Units', textAlign: 'Left', width: 85 },
]
}]},
{ headerText:'Pricing',textAlign:'Left',
columns:[
{ headerText: 'Price Details', textAlign: 'Center',
columns: [
{ field: 'unitPrice', headerText: 'Price per unit', format: 'c2', type: 'number', width: 110, textAlign: 'Right' },
{ field: 'price', headerText: 'Total Price', width: 110, format: 'c', type: 'number', textAlign: 'Right' }
]
}
]}
]
});
treeGridObj.appendTo('#TreeGrid');
|