We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Multi level Stacked Headers

Thread ID:

Created:

Updated:

Platform:

Replies:

141926 Jan 10,2019 04:00 PM UTC Jan 11,2019 04:38 AM UTC JavaScript - EJ 2 1
loading
Tags: TreeGrid
Mohamed Salah
Asked On January 10, 2019 04:00 PM UTC

Hello,
     I want to make multi level Stacked Headers in tree grid like attached image.

Regards, 
M. Salah

Attachment: Capture_cbe6f094.rar

Vignesh Natarajan [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;