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

Question treeColumnIndex

Thread ID:





131748 Jul 25,2017 06:58 PM UTC Jul 27,2017 04:15 AM UTC JavaScript 3
Tags: ejTreeGrid
Daniela Menezes Tunes
Asked On July 25, 2017 06:58 PM UTC


I wonder if it is possible to define more than one column for the treeColumnIndex property? Example, I would like to set it to column 1 and 2.
By google translator


Jayakumar Duraisamy [Syncfusion]
Replied On July 26, 2017 11:16 AM UTC

Hi Daniela, 
In TreeGrid, we can render only one column as tree column using treeColumnIndex property, but the requirement for rendering more than one column as tree columns in TreeGrid can be achieved using column template support. It is possible to render many custom columns like tree column with same behavior. 
Please refer following code snippet, 
treeColumnIndex: 1, 
columns: [ 
   { field: "taskID", headerText: "Task Id" }, 
   {field: "taskName", headerText: "Task Name" },                     
   { field: "startDate", headerText: "Start Date", editType: "datepicker", format: "{0:M/dd/yyyy}" }, 
   { field: "endDate", headerText: "End Date", editType: "datepicker", format: "{0:M/dd/yyyy}" }, 
   { field: "priority", headerText: "Priority", isTemplateColumn: true, templateID: "customColumnTemplate" }, 
   { field: "progress", headerText: "Progress", editType: "numericedit"}, 
<script type="text/x-jsrender" id="customColumnTemplate"> 
        <div style='height:20px;' unselectable='on'> 
            {{if hasChildRecords}}<div class='intend' style='height:1px; float:left; width:{{:level*20}}px; display:inline-block;'></div> 
            {{else !hasChildRecords}} 
            <div class='intend' style='height:1px; float:left; width:{{:(level)*20}}px; display:inline-block;'></div> 
            <div class='{{if expanded}}e-treegridexpand e-icon {{else hasChildRecords}}e-treegridcollapse e-icon {{/if}} {{if level===4}}e-doc{{/if}}' style='height:20px;width:30px;margin:auto;float:left;margin-left:10px; 
       style=' float left;display:inline-block; unselectable='on'></div> 
            <div class='e-cell' style='display:inline-block;width:100%' unselectable='on'>{{:#data['priority']}}</div> 
We have also prepared a sample for your reference. Please find the sample location link as below, 
Please let us know, if you require any other assistance on this. 
Jayakumar D 

Daniela Menezes Tunes
Replied On July 26, 2017 07:43 PM UTC


Worked! Thanks for your help!


Jayakumar Duraisamy [Syncfusion]
Replied On July 27, 2017 04:15 AM UTC

Hi Daniela, 
We are glad that your requirement has been met. Please let us know if you need any other assistance. 
Jayakumar D 


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