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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Fixed column width with full width in treegrid

Thread ID:

Created:

Updated:

Platform:

Replies:

129052 Feb 23,2017 12:53 PM UTC Feb 24,2017 11:55 AM UTC JavaScript 1
loading
Tags: ejTreeGrid
Mohamed Salah
Asked On February 23, 2017 12:53 PM UTC

Hi,
How can I make column width when load tree grid with resize mode 'fixed column' to full in tree grid like normal mode
Regards,
M. Salah

Jonesherine Stephen [Syncfusion]
Replied On February 24, 2017 11:55 AM UTC

Hi Mohamed, 
Thanks for contacting Syncfusion support. 
As per our current behavior we can’t able to stretch the column to auto width using “FixedColumns” mode. We have prepared the work around and rendered column with given width values in column collection. We have achieved this by using create client side event and removed the style attribute of other columns. 
Please find the code example below: 
$("#TreeGridContainer").ejTreeGrid({              
                columnResizeSettings: { 
                    columnResizeMode: ej.TreeGrid.ColumnResizeMode.Normal 
                },               
                columns: [ 
{ field: "taskID", headerText: "Task Id", editType: "numericedit", width: "45" }, 
{ field: "taskName", headerText: "Task Name", editType: "stringedit", width: "200" },                 
], 
               create: function (args) { 
             var $cols1 = this.getContentTable().children("colgroup").find("col"), 
             $cols2 = this.getHeaderTable().children("colgroup").find("col"); 
                    $($cols1[2]).removeAttr("style"); 
                    $($cols1[3]).removeAttr("style"); 
                    $($cols1[4]).removeAttr("style"); 
                    $($cols2[2]).removeAttr("style"); 
                    $($cols2[3]).removeAttr("style"); 
                    $($cols2[4]).removeAttr("style"); 
                },            
 }) 
We have also prepared the sample based on this. Please find the sample from below location 
Regards, 
Jone sherine P S 


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.

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

;