Hi,
I have enabled grouping on a grid which groups my dates by week number, so data looks like this;
Week #1
– Jan 12, 2016
– Jan 20, 2016
Week #37
– Sept 9, 2015
– Sept 11, 2015
However, I want the date (and as a result the groupings) to sort by the actual date. I.e., the data should look like this;
Week #37
– Sept 9, 2015
– Sept 11, 2015
Week #1
– Jan 12, 2016
– Jan 20, 2016
I have tried playing around with the sort order on the grid and in the grouping and this does not change. I have even tried creating a custom column that could be manually toggled to set the DISPLAY ORDER but this does not work either.
How do I get the grid to sort the groupings correctly, instead of just by the Week #.
Thank you – Greg
For week descending sort, you need to set it in grouping options.
$grid["groupingView"]["groupOrder"] = array("desc"); // show group in asc or desc order
$grid["groupingView"]["groupDataSorted"] = array(true); // show sorted data within group
To make date sort ascending, you can
$grid["sortname"] = 'invdate'; // by default sort grid by this field
$grid["sortorder"] = "asc"; // ASC or DESC