Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • ewajoom
  • ewajoom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 36
  • Thank you received: 2
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);

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

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

  • ewajoom
  • ewajoom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 36
  • Thank you received: 2
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)

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.099 seconds

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started