Hi,
great work with the grid so far.
Although, after upgrading to 4.5.2 and setting multiSort to true, I cant seem to be able to sort the grid with multiple columns by code.
i.e:
Hello,
Thanks for this. Will maybe improve sortGrid function.
Currently in order to achieve this you will need to call sortGrid (in multiSort set to true) several times like this.
jQuery(“#grid”)
.jqGrid('sortGrid', “Field1″, true, “asc”)
.jqGrid('sortGrid', “Field2″, true, “desc”);
Regards
Seems to be working, thanks alot!
Right now to walk around of the grid not minding the sort order i ask, i have to set each ColModel[index].lso to the opposite order.
And also, have to set the
Hello,
Thank you very much. Fixed in GitHub
Regards
OronMorad said:
Right now to walk around of the grid not minding the sort order i ask, i have to set each ColModel[index].lso to the opposite order.
Great thanks.
Just making sure you know this is a different issue from the quote above.
Hi guys, I am using the jqgrid multisort for a project. My requirement is to sort
Hello,
Should I understand that you execute the above code several times – i.e with asc parameter. How do you call the second and third sorting?
Regards
Hi Tony, thanks for such a quick reply!
This is how I have am doing it on my jsp –
When the user wants to sort the grid on multiple columns, she has to press a sort button provided on the screen. This will take her to a pop up window where all the columns of the grid by the name are shown.
Hi Tony, Any updates please?
Hello,
It seems that there is a problem with this. I will try to fix this for the upcomming release (very soon)
Regards
Hi Tony, I was able to implement my requirement by using 'GridUnload' for destroying the previous sorting cirteria and order. But I have run into another problem. It seems, at least to me, that jqgrid always gives precedence to the left most column while sorting with multiSort : true.
I mean even if I am executing the following command –
jQuery(“#grid”).jqGrid('sortGrid', “Field1″, true, “asc”).jqGrid('sortGrid', “Field2″, true, “asc”);
where I would expect the outcome to be a grid sorted on “Field1” first and then on “Field2”, the outcome is this only when “Field1” is on the left of “Field2”. Whenever the “Field1” is on the right of “Field2” the actual outcome will be a grid sorted on “Field2” first and then on “Field1”.
Kindly tell me, whether my observation is a mistake from my end or is it actually
Hi Tony, Even i am facing same problem just like steve. jqgrid always gives precedence to left most column for multisort.i was looking in detail at jquery.jqgrid.js for multi sort and what i felt that it always look at in colmodel sequence to append sort name . line 2239
ts.p.sortorder = “”;
         $.each(cm, function(i){
            if(this.lso) {
               if(i>0 && fs) {
                  sort += “, “;
               }
               splas = this.lso.split(“-“);
               sort += cm.index || cm.name;
               sort += ” “+splas[splas.length-1];
               fs = true;
               ts.p.sortorder = splas[splas.length-1];
            }
         });
         ls = sort.lastIndexOf(ts.p.sortorder);
         sort = sort.substring(0, ls);
         ts.p.sortname = sort;
ts.p.sortname = sort; – this is always will be Left columm asc/desc, Right column asc/desc
No matter if you have sort order with Field2(right col), Field1(left col).
Â
I also tried to change ts.p.sortname to proper sequence based on header click, though data is not sorting the way we click header. it always sorts left column and then right column.
Am i missing something here? trying to fix that issue but no luck. do you have any updates?
Hello,
This will be updated and additionally to that there will be a possibility to define the multisort in way the user click on the column – i.e we will not count it from left to right.
Kind Regards
hey tony thanks for reply. but does it means we can not do reverse multisort with current version? if so is there any workaround for now?Â
I have fix to this problem after modification of some part of the jquery.jqgrid.js file.
i am trying to post the code here somehow getting error. is there way i can attach js file here?
Hello,
You can use diffrent editors – just go in your proffil and select BBcode editor if you have problem with this.
Also you can use GitHub to post changes.
Thank you.
Kind Regards
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top