EasyUI Forum
March 28, 2024, 11:54:46 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Resize datagrid column width programmatically  (Read 6578 times)
oyvind
Newbie
*
Posts: 4


View Profile
« 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!
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 15, 2017, 07:30:07 AM »

Please look at this topic https://www.jeasyui.com/forum/index.php?topic=3321.0
Logged
oyvind
Newbie
*
Posts: 4


View Profile
« Reply #2 on: May 15, 2017, 07:56:23 AM »

That works, thank you! I should learn to search more haha.  Smiley
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!