EasyUI Forum
May 05, 2024, 03:55:01 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Double click event on column resize  (Read 10384 times)
A-K
Full Member
***
Posts: 122


View Profile WWW
« 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:


And after double clicking on the resize I want it to look like this:


Thanks!
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #1 on: November 13, 2014, 07:06:01 AM »

Any chance to help with this?
I really want to know if this is possible.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #2 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
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #3 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).
« Last Edit: November 14, 2014, 06:35:44 AM by A-K » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 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.
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #5 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!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!