Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Recall and set column widths
23/11/2009
02:54
Avatar
Clement
Member
Members
Forum Posts: 48
Member Since:
30/03/2009
sp_UserOfflineSmall Offline

Hi,

Users like the column widths to be reinstated whenever they come back to their page. I read the documentation but setColProp would not have any effect on width.

As mentioned above the options in colModel can be get or set using the methods getColProp and setColProp. Below are options which can not be changed dynamically when the grid is constructed (If changed they do not have effect or will cause the grid errors). For some of these options there are methods available to change the value.

  • name
  • width
  • resizable
  • label (method avail.)
Does this mean that we can only set column width at the time of constructing the colModel? We are using jqgrid 3.6
Thanks!
23/11/2009
11:48
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

This is partially true. 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);

Regards

Tony

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

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

23/11/2009
21:50
Avatar
Clement
Member
Members
Forum Posts: 48
Member Since:
30/03/2009
sp_UserOfflineSmall Offline

Thanks! I'll try it out.

25/11/2009
09:51
Avatar
Clement
Member
Members
Forum Posts: 48
Member Since:
30/03/2009
sp_UserOfflineSmall Offline

I realized that the columns width are recalled correctly but readjusted due to shrinkToFit = true. Would it be possible to leave the widths as they are, even with horizontal scrollbars if needed.

Thanks!

26/11/2009
10:30
Avatar
Clement
Member
Members
Forum Posts: 48
Member Since:
30/03/2009
sp_UserOfflineSmall Offline

I'm still stuck.. really appreciate some help here.. thank you!!

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
46 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information