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.
Unfortunately, activation email could not send to your email. Please try again.

Question treeColumnIndex

Thread ID:

Created:

Updated:

Platform:

Replies:

131748 Jul 25,2017 02:58 PM Jul 27,2017 12:15 AM JavaScript 3
loading
Tags: ejTreeGrid
Daniela Menezes Tunes
Asked On July 25, 2017 02:58 PM

Hi,

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

Thanks,
Regards,
Daniela

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

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, 
$("#TreeGridContainer").ejTreeGrid({ 
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"}, 
                ] 
[template] 
<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> 
            {{/if}} 
            <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> 
        </div> 
    </script> 
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. 
Regards, 
Jayakumar D 


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

Hi,

Worked! Thanks for your help!

Regards,
Daniela.


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

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


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.

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.

;