Welcome, Guest
Username: Password: Remember me

TOPIC: group by in grid layouts

group by in grid layouts 05 Nov 2013 10:17 #11538

  • ewajoom
  • ewajoom's Avatar
  • Offline
  • Junior Member
  • Posts: 36
  • Thank you received: 2
  • Karma: 0
Hi, when generated grid layout, the query only do an order (no group by).
To change this I have to manually edit in model :
//GROUP ORDER : Prioritary order for groups in lists
foreach($this->getState('query.groupOrder', array()) as $groupOrder)
$query->order($groupOrder);
by
//GROUP ORDER : Prioritary order for groups in lists
foreach($this->getState('query.groupOrder', array()) as $groupOrder)
$query->group($groupOrder);
The administrator has disabled public write access.

group by in grid layouts 05 Nov 2013 18:23 #11539

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
This is absolutly normal.

The grid groups are different than Group By from SQL.

It only applies a prioritary order that is a group a FK value, the more oftenly)
When the group value changes, it show a new header in the grid with contained elements inside.

You can instance unlimited group levels.
Coding is now a piece of cake
The administrator has disabled public write access.

group by in grid layouts 05 Nov 2013 21:27 #11540

  • ewajoom
  • ewajoom's Avatar
  • Offline
  • Junior Member
  • Posts: 36
  • Thank you received: 2
  • Karma: 0
Okay I understand why it's like that, thanks for explanation.
(the fact is that in this case I needed an SQL group by to use some aggregates functions in grid)
The administrator has disabled public write access.
Time to create page: 0.110 seconds

Get Started