EasyUI Forum
November 05, 2025, 03:03:04 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: Datagrid Re-Fit after Colum Show / Hide  (Read 24181 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: March 21, 2012, 01:11:02 AM »

I have a data grid with say 10 frozen columns and 2 non frozen ones with fitColumns set to true.

This does exactly what I want and works GREAT, in that only the last 2 columns are stretched / squeezed to fit the remaining window width.

But the problem is I cannot get them to re-fit after a column has been hidden or displayed, I have tried all of these but nothing appears to re-fit the columns:

Code:
$('#data').datagrid('fixColumnSize');
$('#data').datagrid('fitColumns');
$('#data').datagrid('reload');

Any ideas Huh
Logged

-- Licensed User --
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #1 on: March 28, 2012, 11:57:39 PM »

Bump...
Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #2 on: March 29, 2012, 12:34:32 AM »

May be you should past some test code or describe more detail on how to call your 'fitColumns' method.
Logged
Ellipsis
Full Member
***
Posts: 113


View Profile WWW
« Reply #3 on: October 19, 2012, 03:54:16 AM »

same problem here.

calling ::

Code:
jQuery('#1').datagrid('fitColumns');    // nothing happens 

// or
fitColumns: true,   // no luck ....
pagination: true,
singleSelect: true,

and something strange:

Code:
jQuery('#1').datagrid('resize');  // the grids shrinks when you keep calling this 
please help!!
« Last Edit: October 19, 2012, 04:34:34 AM by reno1979 » Logged
Ellipsis
Full Member
***
Posts: 113


View Profile WWW
« Reply #4 on: October 26, 2012, 04:53:08 AM »

bump..
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #5 on: October 26, 2012, 06:38:47 AM »

Please refer to this example http://jsfiddle.net/SE5jc/. It seems that there are no problems with the 'fitColumns' method.

Click the 'HideF5' link to hide the column 'f5', the columns re-fit fine.
Click the 'HideF3' link to hide the column 'f3', the columns can't re-fit because the 'f3' is a frozen column. Click the 'ReFit' link and you will see re-fit works fine.

With the 'fitColumns' property set to true, the columns will be stretched to fit the remain column width. Thus the horizontal scroll bar will disappear. The user does not need to define the 'frozenColumns' again.
« Last Edit: October 26, 2012, 06:57:02 AM by stworthy » 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!