Forum
20:16
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.
15:59
Moderators
30/10/2007
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.
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.
14:49
Moderators
30/10/2007
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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66