EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: oyvind on May 15, 2017, 04:57:41 AM



Title: Resize datagrid column width programmatically
Post by: oyvind on May 15, 2017, 04:57:41 AM
Hello again, thanks for previous help!

I was wondering if it is possible to change the size of a column in a datagrid programmatically.

Something like:
$('#dg').datagrid('resizeColumnWidth', {field: 'col1', width: 100});

I tried using the cellClass from column options with the jQuery width() method [ $('.' + cellClass).width(100);], and do the same thing in the resize event of the datagrid. That works, but to me it seems like I'm adding unnecessary code.
Sorry if there is an obvious answer; I have been searching the documentation.

Thank you!


Title: Re: Resize datagrid column width programmatically
Post by: stworthy on May 15, 2017, 07:30:07 AM
Please look at this topic https://www.jeasyui.com/forum/index.php?topic=3321.0


Title: Re: Resize datagrid column width programmatically
Post by: oyvind on May 15, 2017, 07:56:23 AM
That works, thank you! I should learn to search more haha.  :)