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
Reload after setGridParam() does not re-draw column titles
07/09/2009
20:26
Avatar
Matt P
Guest
Guests

Hi,

jqGrid is a fantastic product. Keep up the good work! Laugh

If I use setGridParam() to set jqGrid params (saved in cookie for example) which includes colModel params of 'hidden = true' for some columns, then trigger a reload so the param changes are visible, the column titles do not get refreshed which means they remain visible even though the data for that column has been hidden.

To reproduce:

  1. Open fresh jqGrid
  2. Use the Show/Hide Columns widget to hide some columns
  3. Save the params somewhere using getGridParams() function
  4. Do a browser refresh to get a fresh jqGrid which has all columns visible
  5. Use the setGridParams() function with the data saved in step 3 as the argument to set the grid parameters
  6. Trigger a reload of the jqGrid

Also, is there a function to redraw the grid without re-loading the data?

Cheers,

Matt.

08/09/2009
07:30
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You can not do this - see form post on this

5. Use GridUnload method to clear the grid and its parameters.

6. set jqGrid with the saved parametrs. (you should not use reload in this case)

Regards

Tony

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.

15/09/2009
18:10
Avatar
Matt P
Guest
Guests

OK, I've finally worked it out - I think. In order to dynamically load a previously saved layout for a grid, the following conditions need to be met:

  1. The saved layout (saved after using the JSON.stringify(myjqGridObject.getGridParam()) method) must be saved from a grid which did *not* use a jQuery object to specify the "pager" option when it was created.
  2. The existing grid (which you are wanting to redraw with the saved layout) needs to be first cleared by using the GridUnload() method.
  3. A new grid needs to be created on the same HTML element as the previous grid, using the saved layout from step 1 as the argument. eg $('#myGrid').jqGrid(JSON.parse(savedParamsString));
Let me know if I have missed anything.
Cheers,
Matt.
18/09/2009
02:28
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I think no.

Regards

Tony

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
90 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