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
sortableRows - how to use it? it's jQuery UI... i know
01/12/2009
20:16
Avatar
Attila F
Guest
Guests

Really great plugin, i use it in my CMS, thanks for creating this.

One question: I'm having hard time here to implement the sortableRows feature.

I'd like to see a demo on how to read the grid's sorted values, also some useability best practice (row sorting is relevant if the sorted column is the 'position' column).

What i'm trying to do here is (but serial is undefined):

  jQuery(”#list”).jqGrid('sortableRows',
          {
             cursor: '.handle',
            update : function () {
                var serial = jQuery('#list').sortable('serialize');
                alert(serial);               
            }
          }
      );

Then I would get the pages first items offset, send the offset and the serialized id's to the server and make :

i =0;

foreach(id from my post) {

update test_table set position = offset + i where tableid = id;

// offset is a positive number equal to the position of the first item on current page

i++;

}

another way is to somehow find out what id was inserted in front of what id, send both to server, then make some updates in the database.

Could someone please provide me a practical example on how to read the sort values?

Thanks.Cool

02/12/2009
15:49
Avatar
Attila F
Guest
Guests

anybody? Smile

02/12/2009
15:59
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Have missed your post - sorry.

Serialize would not work since we bind sortable to the table body of the grid

Also you can use getDataIDs  method to obtain the ne id's after resorting, or use getRowData without parameter to get all rows

These are arays so you can serialize them and send it to server;

jQuery(”#list”).jqGrid('sortableRows',
   {
  cursor: '.handle',
  update : function () {
      var serial = jQuery('#list').jqGrid('getRowData');

       //serialize the array here
   }
 });

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.

03/12/2009
17:56
Avatar
attilaf
New Member
Members
Forum Posts: 1
Member Since:
01/12/2009
sp_UserOfflineSmall Offline

thank you, it works now.

One issue i found with ordering. You can see it on http://www.youtube.com/watch?v.....WD3UNTocoI

As you can see, when i drag the first row to sort, something strange happens to the columns.

05/12/2009
14:49
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

It is not strange, but it is related to the nature of the grid and the jQuery UI sortable. Also not sure if this can be fixed easy.

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