EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: A-K on November 11, 2014, 08:46:31 AM



Title: Double click event on column resize
Post by: A-K on November 11, 2014, 08:46:31 AM
Hey,
All my columns width are configured by percentage and I want to create the option for my users
that when double clicking on the resize column(The one that activates the onResizeColumn) the width of the column will shrink to the width of the content inside,
Is it possible?

It should look like this, this is the default size of the column:
(http://i59.tinypic.com/dg3vv7.png)

And after double clicking on the resize I want it to look like this:
(http://i59.tinypic.com/5koaaw.png)

Thanks!


Title: Re: Double click event on column resize
Post by: A-K on November 13, 2014, 07:06:01 AM
Any chance to help with this?
I really want to know if this is possible.


Title: Re: Double click event on column resize
Post by: stworthy on November 13, 2014, 09:52:06 PM
Please try to download the updated 'datagrid-filter.js' file from http://www.jeasyui.com/extension/datagrid_filter.php


Title: Re: Double click event on column resize
Post by: A-K on November 14, 2014, 06:16:56 AM
I am sorry I guess I didn't explain my problem correctly.
I will separate it into 2 questions.

1) Is there a way to make a double click event on the resize column? The one that triggers the onResizeColumn.

2) Is there a way to change the width of a column during run time to be the size of the content inside? when the datagrid is first loaded I need it to have width by percentage, then to be able
to change the width of a column to the content inside (I will use it when the double click event will trigger from the resize).


Title: Re: Double click event on column resize
Post by: stworthy on November 14, 2014, 08:37:43 AM
This is the built-in feature in the datagrid. When double click the column header divider, the column will grow or shrink to fit the size of its content. Calling 'autoSizeColumn' method can also resize the column to fit its content.


Title: Re: Double click event on column resize
Post by: A-K on November 14, 2014, 08:48:12 AM
Sorry for all of this, I didn't know that, and for some reason it didn't work for me. But now I downloaded
the new version and tested again and it works great! Thanks, this is a great feature that helps me a lot!