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
jqGrid columnChooser - choosen columns are inserted after columns specified as hidedlg
27/11/2009
08:05
Avatar
kelny
Member
Members
Forum Posts: 8
Member Since:
26/11/2009
sp_UserOfflineSmall Offline

Hi,

I have problem with columnChooser. I have some columns, which I don´t want to allow user to select in columnChooser dialog, so I mark them with hidedlg:true.Everything works fine, but choosen columns are inserted after those columns, which didn´t appear in the dialog.Is it possible to leave them at original position (end).

Thank You Jan

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

You can pass in your own "done" function (in the columnChooser options). The done function is passed the permutation to be applied (or null if the user cancelled the columnChooser).

The default function is:

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

You would need to modify the permutation to keep your columns where you want them, before calling remapColumns.

The permuation array is such that the column that is currently in position permutation[i] will move to position i.

Mark

30/11/2009
12:58
Avatar
kelny
Member
Members
Forum Posts: 8
Member Since:
26/11/2009
sp_UserOfflineSmall Offline

Hello Mark,

Thank You for Your help.  This solved my problem.





done : function (perm) {

if (perm) {

perm.sort(); /* this solved my problem*/

this.jqGrid('remapColumns', perm, true);

var gwdth = this.jqGrid('getGridParam','width');

this.jqGrid('setGridWidth',gwdth);";

}

}



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

Well, yes - buts its rather drastic...

Now you're not allowing the user to reorder the columns at all, so you're just using the column chooser to show/hide columns. You could actually drop the remapColumns call altogether...

Mark

15/06/2010
12:10
Avatar
Asshiah
Member
Members
Forum Posts: 74
Member Since:
27/04/2010
sp_UserOfflineSmall Offline

Hello,

I Have a similar problem,

I use the column chooser in order to allow the user to show/hide/reorder columns.

But the thing is, when the user hides a column using the column chooser, and then uses it again to show the same column, I want this column to get back to its original position.

Presently, the column is put at the end of all the columns shown in the grid.

I could always use the column chooser's "done" fonction to reorder the columns as is the colmodel when showing columns (the columns order in this one is not modified when just hiding a few columns), but the user will not be able to reorder columns anymore, only show/hide them.

In clear, is there a way to use the column chooser in order to show/hide/reorder columns, but being sure that a column that is hiden then shown us put back to its anterior position before being hiden?

Thanks.

20/06/2010
11:22
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

After you make it visible at left side, you can use drag and drop to put it at its original position.

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:
62 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