|
Title: Datagrid Re-Fit after Colum Show / Hide Post by: devnull 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');Any ideas ??? Title: Re: Datagrid Re-Fit after Colum Show / Hide Post by: devnull on March 28, 2012, 11:57:39 PM Bump...
Title: Re: Datagrid Re-Fit after Colum Show / Hide Post by: stworthy 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.
Title: Re: Datagrid Re-Fit after Colum Show / Hide Post by: Ellipsis on October 19, 2012, 03:54:16 AM same problem here.
calling :: Code: jQuery('#1').datagrid('fitColumns'); // nothing happens and something strange: Code: jQuery('#1').datagrid('resize'); // the grids shrinks when you keep calling this Title: Re: Datagrid Re-Fit after Colum Show / Hide Post by: Ellipsis on October 26, 2012, 04:53:08 AM bump..
Title: Re: Datagrid Re-Fit after Colum Show / Hide Post by: stworthy 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. |