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
Column Chooser Complete Callback
12/11/2009
15:49
Avatar
seph429
Guest
Guests

I am looking for a way to store which columns are hidden and visible so that the user will always have the same settings.

Re-hiding them from an array is easy enough, but there is no reliable way that i have found to SAVE the settings. The most optimal way i'd imagine is having a callback for the columnChooser that fires when a user hits the "Ok" button to save their columns.

12/11/2009
17:08
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Good point, there should be one.

But for now you can just replace the done function in the columnChooser options:

{ done: function(perm) { if (perm) { $("#mygrid").jqGrid("remapColumns", perm, true); /* and whatever else you want */}}}

Mark

13/11/2009
10:03
Avatar
seph429
Guest
Guests

Here is a DIFF for the changes i made, dialogClose is the call back name and can be set using the API

jQuery("#grid").jqGrid('columnChooser', {

dialogClose : function() {}

});

--- C:/Users/mkesler/AppData/Local/Temp/grid.jqueryui.js-revBASE.svn000.tmp.js Fri Nov 13 10:56:36 2009

+++ X:/common/js/grid36-dev/src/grid.jqueryui.js Fri Nov 13 10:48:32 2009

@@ -102,12 +102,16 @@

             "width" : 420,

             "height" : 240,

             "classname" : null,

-            "done" : function(perm) { if (perm) self.jqGrid("remapColumns", perm, true) },

+            "done" : function(perm) { 

+         if (perm) { self.jqGrid("remapColumns", perm, true); }

+         opts.dialogClose();

+         },

             /* msel is either the name of a ui widget class that

                extends a multiselect, or a function that supports

                creating a multiselect object (with no argument,

                or when passed an object), and destroying it (when

                passed the string "destroy"). */

+            "dialogClose" : function() {},

             "msel" : "multiselect",

             /* "msel_opts" : {}, */

 

16/11/2009
23:47
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks. Good idea. Will think if I will include it.

Best 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:
28 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