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
problem with importing remapColumns grid option
10/02/2010
17:27
Avatar
macbuoy
Silver Spring, MD
Member
Members
Forum Posts: 24
Member Since:
16/10/2009
sp_UserOfflineSmall Offline

I am exporting, saving to server and then importing grid options. I use this to save my user's preferences for data sorting, column width and column re-ordering.

That last feature, column re-ordering is a bit of a problem. The grid options are exported and saved with the correct "remapColumns" parameter–it's the permutation array. When the grid loads and the saved options are imported, the columns are properly ordered by the permutation array but the column headings are left in the original, default order.

gridOptions.remapColumns is exported as an array when using the grid export feature:

gridOptions={
  . . .
 ,"remapColumns":[1,2,4,3,5,6]
  . . .
};

again, this approach reorders the columns but leaves the headers in the wrong order.

I have also tried updating the remapColumns option before binding the grid so that it matches the remapColumns method signature:

gridOptions={
  . . .
  ,"remapColumns":{"permutation":[1,2,4,3,5,6],"updateCells":true,"keepHeader":true}
  . . .
};

This last approach doesn't work at all on the columns OR the header row.

Many thanks for such a cool control!! Can anyone tell me what I'm missing here or help me identify a bug?

Thanks!

12/02/2010
18:46
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Do you have hidden fields?

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.

12/02/2010
22:58
Avatar
macbuoy
Silver Spring, MD
Member
Members
Forum Posts: 24
Member Since:
16/10/2009
sp_UserOfflineSmall Offline

Hey Tony! Thanks for your reply. There are, indeed, some hidden fields. This is another one of the features I am saving to the server as my user's settings. Some columns permanently hidden by default and others might end up hidden by the user. Thanks, David

tony said:

Hello,

Do you have hidden fields?

Best Regards

Tony


17/02/2010
12:12
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Will look at this.

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.

17/02/2010
22:00
Avatar
macbuoy
Silver Spring, MD
Member
Members
Forum Posts: 24
Member Since:
16/10/2009
sp_UserOfflineSmall Offline

Thanks!

09/04/2010
10:10
Avatar
teddyboy
Member
Members
Forum Posts: 16
Member Since:
12/11/2009
sp_UserOfflineSmall Offline

Hi Tony

Has the issue been resolved yet, because I would like to do something similar and I have columns which are always hidden and others which the user can show/hide.

Thanks

13/04/2010
17:10
Avatar
teddyboy
Member
Members
Forum Posts: 16
Member Since:
12/11/2009
sp_UserOfflineSmall Offline

Any update on this Tony there's still a problem using remapColumns in the latest release.

Thanks

16/04/2010
17:10
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Currently we check this bug

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.

19/04/2010
13:02
Avatar
teddyboy
Member
Members
Forum Posts: 16
Member Since:
12/11/2009
sp_UserOfflineSmall Offline

Thanks Tony

06/05/2010
16:38
Avatar
teddyboy
Member
Members
Forum Posts: 16
Member Since:
12/11/2009
sp_UserOfflineSmall Offline

Hi Tony

Can you tell me whether this bug is fixed in 3.6.5 ?

Thanks

11/05/2010
14:57
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Sorry no. I do not have a chance to investigate this, but definetley will do 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.

26/05/2010
11:15
Avatar
easytea
New Member
Members
Forum Posts: 1
Member Since:
26/05/2010
sp_UserOfflineSmall Offline

Hey, I had a similar problem. Try setting keepHeader to false, that's what worked for me.

Good luck

28/05/2010
09:35
Avatar
teddyboy
Member
Members
Forum Posts: 16
Member Since:
12/11/2009
sp_UserOfflineSmall Offline

Tried that it didn't work when I moved a column before a non-visible column thanks anyway.

22/07/2010
11:47
Avatar
teddyboy
Member
Members
Forum Posts: 16
Member Since:
12/11/2009
sp_UserOfflineSmall Offline

Hi Tony

Has this been fixed in the latest version ?

Thanks

05/08/2010
15:45
Avatar
teddyboy
Member
Members
Forum Posts: 16
Member Since:
12/11/2009
sp_UserOfflineSmall Offline

Hi Tony

Sorry to pester you about this but is there any chance might fixed in the next release 3.7.3 (?) I've been asked to support this feature and my users are getting  a bit impatient.

Thanks Again

10/08/2010
15:57
Avatar
teddyboy
Member
Members
Forum Posts: 16
Member Since:
12/11/2009
sp_UserOfflineSmall Offline

BTW a simple fix for this is just to make all your columns visible in the data column array. Then in loadBeforeSend first time callback hide the columns bar $('.ui-jqgrid-hdiv').hide() . On gridComplete first time callback call $('#yourGrid').jqGrid('remapColumns',colOrderArry,true,false) and then buildup an array of those columns you want to hide and call $('#yourGrid').jqGrid('hideCol',colArray) and then $('.ui-jqgrid-hdiv').show() to show the column header. This gets over the problem 'remapColumns' has with hidden columns.

07/01/2011
22:34
Avatar
Nils
New Member
Members
Forum Posts: 1
Member Since:
07/01/2011
sp_UserOfflineSmall Offline

Hi Teddyboy,

Thanks for post this workaround.

Just one question regarding this proposed solution.
The main sortable  (column reordering) feature works properly as expected.
But after I reordered some columns and try afterwords to sort one or more columns (asc or desc by clicking onto the column header), my table columns toggle around. In other words I clicked i.e. at column #5 and column #5 becomes column #3 and the original column #3 becomes #5. with another click onto a different column header (totally independed on which one) the columns are toggle back.

...,
loadBeforeSend : function()  {
     jQuery('.ui-jqgrid-hdiv').hide();                              
 },

gridComplete: function() {
     var rv=document.getElementById('column_order').value.split(","); //[0,1,2,3,4,5,6,7,8,9,10,11,12]
     jQuery("#list1").jqGrid("remapColumns",rv, true, false);    
     var hv=document.getElementById('hidden_columns').value.split(",");  //['id','product']
     jQuery('#list1').jqGrid('hideCol',hv);
     jQuery('.ui-jqgrid-hdiv').show();
 },...

BTW as hint: I got more than one sort arrow at the grid (but just one per column).  That's strange, but just with the above descripted senario.

Thanks

Nils

16/05/2013
12:31
Avatar
venugopalsmartboy
Member
Members
Forum Posts: 4
Member Since:
04/03/2013
sp_UserOfflineSmall Offline

A simple yet efficient work around is , use  label option in the colModel to set the grid headers and avoid using colNames.  That will set things properly.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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