Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
57
rated 0 times [  64] [ 7]  / answers: 1 / hits: 34731  / 12 Years ago, wed, august 29, 2012, 12:00:00

I understand that the width of each column of jqgrid is defined using colModel parameter. Assuming I want to resize a column after I click a button, how can I perform this?


More From » jqgrid

 Answers
10

You can set the new width of the column using two methods – setColProp and setGridWidth.



Here is example of setting new width of the column amount:



$(#mygrid).jqGrid('setColProp','amount',{width:new_width});

var gw = $(#mygrid).jqGrid('getGridParam','width');

$(#mygrid).jqGrid('setGridWidth',gw);


P.S. Note that in order to work this a shrinkToFit should be true, or you should call setGridWidth with second parameter true


[#83364] Monday, August 27, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
devinjadong

Total Points: 711
Total Questions: 117
Total Answers: 100

Location: Andorra
Member since Sat, May 27, 2023
1 Year ago
devinjadong questions
Thu, Feb 17, 22, 00:00, 2 Years ago
Wed, Dec 8, 21, 00:00, 2 Years ago
Tue, Oct 27, 20, 00:00, 4 Years ago
Fri, Oct 18, 19, 00:00, 5 Years ago
;