EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: A-K on December 08, 2014, 03:43:55 AM



Title: problem when calling the treegrid constructor
Post by: A-K on December 08, 2014, 03:43:55 AM
Hey,
I have a problem calling the constructor of the treegrid like this code:

Code:
$('#tg').treegrid({
        autoRowHeight: false,
        nowrap: false
    });

Instead of just expanding all my rows that their content is bigger then the width it will
restore all the columns width to their initialized width. and only when ill resize the columns width again
it will take effect.

Image of columns width to small for the content:
(http://i58.tinypic.com/2dv0spe.png)

After calling the code above it will restore my columns width.. instead of just expanding it:
(http://i62.tinypic.com/dcxw61.png)

The same code in the datagrid does not restore the columns width and works perfectly.
Any fix for this?

Thanks!


Title: Re: problem when calling the treegrid constructor
Post by: stworthy on December 08, 2014, 07:59:02 AM
Please refer to this example http://jsfiddle.net/9kfg5y02/


Title: Re: problem when calling the treegrid constructor
Post by: A-K on December 08, 2014, 08:12:38 AM
I am sorry but it does not fix the problem. in the example, you gave a width of 60 to the column 'size'
but if I change the width to 150 like in this example: http://jsfiddle.net/9kfg5y02/1/ (http://jsfiddle.net/9kfg5y02/1/)
you can see it doesnt work well..

I need to let my users an option that at any given time they can active this feature after playing with the columns size.
I cannot start my treegrid when the column width is already smaller then the content..

This example of the same case in the datagrid works just fine: http://jsfiddle.net/9kfg5y02/2/ (http://jsfiddle.net/9kfg5y02/2/)

Any other way to fix this?


Title: Re: problem when calling the treegrid constructor
Post by: stworthy on December 08, 2014, 09:06:33 AM
Although we run this example on safari,chrome,ie,..., but it works well and does not occur the appearance you pointed.


Title: Re: problem when calling the treegrid constructor
Post by: A-K on December 08, 2014, 09:14:51 AM
I am using the latest chrome Version 39.0.2171.71 m.

In your tests when you run this example http://jsfiddle.net/9kfg5y02/1/ (http://jsfiddle.net/9kfg5y02/1/)
if you change the size of the column at run time until the width of the column is smaller then the content
and then you press the "Recreate" button the width of the column isnt restored to its default size for you?

I have tested this also in firefox and its the same behavior, and in the datagrid it works great.



Title: Re: problem when calling the treegrid constructor
Post by: A-K on December 08, 2014, 10:14:45 AM
I also uploaded a video to youtube where I show the problem in the treegrid.

https://www.youtube.com/watch?v=cq-850GiX8s (https://www.youtube.com/watch?v=cq-850GiX8s)

0-8 second of the video show the behavior in the treegrid.

the rest of the video shows the behavior in the datagrid which works correctly.


Title: Re: problem when calling the treegrid constructor
Post by: stworthy on December 08, 2014, 07:17:14 PM
Please try to download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4.1-patch.zip.


Title: Re: problem when calling the treegrid constructor
Post by: A-K on December 08, 2014, 11:10:58 PM
Thank you! Works perfectly!