- Home
- Forum
- JavaScript - EJ 2
- Multi level Stacked Headers
Multi level Stacked Headers
Hello,
Attachment: Capture_cbe6f094.rar
I want to make multi level Stacked Headers in tree grid like attached image.
Regards,
M. Salah
Attachment: Capture_cbe6f094.rar
SIGN IN To post a reply.
1 Reply
VN
Vignesh Natarajan
Syncfusion Team
January 11, 2019 04:38 AM UTC
Hi Mohammed Salah,
Thanks for using Syncfusion products.
Query: “ I want to make multi level Stacked Headers in tree grid like attached image.”
From your query, we understand that you need to render the TreeGrid with multi level stacked header. We have achieved your requirement by defining the columns inside another column.
Refer the below code example
|
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');
|
Refer the below screenshot for the output
|
|
For your convenience we have prepared a sample which can be referred from below
Please get back to us if you have further queries.
Regards,
Vignesh Natarajan
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
MS Mohamed Salah
- Jan 10, 2019 04:00 PM UTC
- Jan 11, 2019 04:38 AM UTC