GroupingView sorted by Nb of occurences

QuestionsGroupingView sorted by Nb of occurences
Jean-Luc Marmier asked 4 years ago

Hello,

Is there a way to sort Grouped Columns by the number of rows occurences :

View post on imgur.com

Rather than the Column value.

 

Thanks in advance.

Jean-Luc

 

4 Answers
Abu Ghufran Staff answered 4 years ago

Please refer this code:

https://gist.github.com/f32c22a0b1a045e8acea3aa7aa601db4

Line 51,86,99

 

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Jean-Luc Marmier answered 4 years ago

Hello,

Thanks for your input.

This is working fine as long as no line (order_id in your case) is filtered.
How to get the same result when some records are ‘dynamically’ filtered ?

Thanks in advance for your additional input.

Jean-Luc

Jean-Luc Marmier answered 4 years ago

Hello again,

I managed to generate dynamically the SQL statement to be used in grid ‘sortname’.

What is the syntax in JS to set grid sortname before refreshing it ?

Best Regards,

Jean-Luc

Abu Ghufran Staff answered 4 years ago

Hi,

You can try following, this will sort list1 grid with country column descending after reload.

var grid = jQuery('#list1');
grid.jqGrid('setGridParam',{sortname: 'country', sortorder: 'desc'});
grid.trigger('reloadGrid',[{current:true}]);
_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

16 + 19 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?