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
ColumnChooser save to server
25/11/2009
16:41
Avatar
dpeterman
Member
Members
Forum Posts: 10
Member Since:
19/10/2009
sp_UserOfflineSmall Offline

Tony,

Any chance of adding a call back on "done" for the columnChooser? It would nice to be able to save the column configuration to the server.

Also, being able to order the columns would be fantastic. Instead of a list of columns you could have 2 lists. The left hand side would contain the hidden columns and the right hand side for the displayed columns. Then add some up/down arrows to the "display" list to re-order the columns (also drag n drop would nice).

Love the tool--Doug

25/11/2009
18:06
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

dpeterman said:

Any chance of adding a call back on “done” for the columnChooser? It would nice to be able to save the column configuration to the server.

Also, being able to order the columns would be fantastic. Instead of a list of columns you could have 2 lists. The left hand side would contain the hidden columns and the right hand side for the displayed columns. Then add some up/down arrows to the “display” list to re-order the columns (also drag n drop would nice).


There is a "done" callback, but its harder than necessary to intercept (basically, if you intercept it, you're responsible for calling reorderColumns). This should be fixed...

The default callback does this:

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

You can replace it with one that does that, and then whatever you want.

As for the re-ordering, and two lists - you described /exactly/ how it works today (except that the displayed items are on the left!).

Im guessing you need to include ui.muiltiselect.js (without that you'll just get a standard <select multiple> element)

Mark

28/11/2009
06:58
Avatar
csitol
NC
Member
Members
Forum Posts: 13
Member Since:
02/08/2009
sp_UserOfflineSmall Offline

This (sending the information back to the server) is very easy to accomplish.  There's a function available called "getGridParam" that takes the 'colModel' information from the JS setup (hopefully this makes sense).  This returns all of the information about the columns including which are hidden, the order, etc.  If you're using PHP you JSON.stringify the data you get back and then send it as an Ajax call to your PHP (or whatever) code.  Then you can decide where to keep it, etc.  If you need code for this and you're using PHP and MySQL I'd be more than happy to send you what I've done.

To my mind this is the best of both worlds; you get to decide how to store the data but it's easy to retrieve from jqGrid!

Also, to further what markw65 said, the DND option in the hide selection list is already there and works perfectly.

Regards,

PhilM

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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