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
Event triggered by column reorder?
03/02/2010
17:41
Avatar
liammkelly
Member
Members
Forum Posts: 4
Member Since:
10/11/2009
sp_UserOfflineSmall Offline

Hi guys,

Love the grid, it has changed my life.  I am trying to store the new order of columns whenever the user reorders them.  Currently I am using this hack:

 $('th[role=columnheader]').mouseup( function() {

setTimeout('reorderColumns(currentSystemID)',1000);

})

function reorderColumns(sys) {

var reorderArray = new Array();

     $.each( $('#queue_grid_'+sys).getGridParam('colModel'), function(e,f) {

reorderArray[e] = new Array();  

reorderArray[e][0] = f.index; 

reorderArray[e][1] = f.width;

// logic for storing these attributes here

// …

  })

However, sometimes this works and sometimes it doesn't.  Is there an actual method triggered by the reorder I can use?  

Thanks!!!

Liam

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

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

Hello,

I think yes, if I understand right.

In the gridOptions define

sortable: {options:{here_all the options for sortable widget}}

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.

05/02/2010
18:01
Avatar
liammkelly
Member
Members
Forum Posts: 4
Member Since:
10/11/2009
sp_UserOfflineSmall Offline

Thanks Tony!  I implemented this:

sortable: {update: function(event, ui) {

reorderColumns(currentSystemID);

}}

and it works great.

Liam   

18/06/2013
09:40
Avatar
venugopalsmartboy
Member
Members
Forum Posts: 4
Member Since:
04/03/2013
sp_UserOfflineSmall Offline

Hi Tony,

If I use like this,

                sortable:{

               options: {
                  stop: function(event, ui) {

                     var d = $("div.ui-jqgrid-sortable",$(ui.item));
                    console.log('Colomn "'+ d.text() + '" was reorded');
                      
                         },
                  update: function(relativeColumnOrder) {
                  console.log("in update");
                   

                       }

                  }

             },

The sortability is not working. Though the headers are moving, but the data in the grid is not moving.

You can find the same  in this  jsbin example. Please suggest on how to go ahead on this.

18/06/2013
09:49
Avatar
venugopalsmartboy
Member
Members
Forum Posts: 4
Member Since:
04/03/2013
sp_UserOfflineSmall Offline

According to this post in trirand forum,

 sortable : { options : { <whatever sortable options you want> },

              update : function(perumtation) {},

            },

This is working great.. thanks to the jqGrid development teams and support communities..

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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