Forum
03:01
Moderators
30/10/2007
Hello,
You can do that.
1. You can define in the index multiple names something like
index: " name1 name2" - this string will be send to the server and you
can get it and sort appropriate way.
2. Use onSortCol to do that - also you can check example how
we can sort on hidden fields - the things are the same.
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.
13:33
Moderators
30/10/2007
Hello,
For the first you can use the hints in this topic.
For the second my ansver is: currently not possible.
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.
10:02
Moderators
30/10/2007
Hello,
To be a clear. When you click on one column you can simulate a sort on multiple coulmns sending the appropriate data to the server, but we can not sumulate this beghaviour (or at leaset is difficult) - click and some column (the data is sorted and sorting image appear), click on other column the sort of the first should remain again with the image, but again sorted to the second with the image and etc.
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.
20:56
30/03/2009
Hi Tony,
Do you mean adding two onSortCol events (one desc and the other asc) for each column and each click to update the sortname and sortorder via setGridParam?
For example, initial sort is "Col_1 asc"
Then clicking on Col_2 would set sortname to "Col_1 asc, Col_2" and sortorder to "asc". Next click on Col_3 would set sortname to "Col_1 asc, Col_2 asc, Col_3" and sortorder to "asc". I think you have something else in mind.
My approach above seems to create a mess if I click on the same column more than once. A search and replace function would need to be in place to manipulate the sortname string and retain the order of last clicked column in sortorder. I would also need a sort reset button. Not elegant at all..
Please advise further.. Thanks!
03:25
Moderators
30/10/2007
Hello Clement,
I'm not sure that what you want can be done with jqGrid.
I mean the following.
When you click on one column to sort you can add many columns to the request, but nothing more
something like
onSortCol : function(index, iCol, sortorder) {
if(index=='some') {
$("#mygrid").setGridParam({sortname: "col1 col2 col3..',sortorder:'asc or desc'});
}
if(index=='other') {
$("#mygrid").setGridParam({sortname: "col3 col2 col1..',sortorder:'asc or desc'});
}
}
Do you see what I mean, but nothing more
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.
01:51
30/03/2009
Hi tony,
That's part of my requirements.. I also need subsequent clicks on same column header to reverse the sort direction or remove sorting on that column.
For example, we have columns A, B and C.
First click on column A -> sort parameter: A asc
Then click on B -> sort parameter: A asc, B asc
Then click on C twice -> sort parameter: A asc, B asc, C desc
Then click on B -> sort parameter: A asc, B desc, C desc
Then click on B again -> sort parameter: A asc, C desc (Sort on B is off)
Thanks!
Most Users Ever Online: 715
Currently Online:
47 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