Welcome, Guest
Username: Password: Remember me

TOPIC: How to setup default order in grid

How to setup default order in grid 19 Jul 2013 21:04 #10532

  • pinochet
  • pinochet's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Karma: 0
Greetings, I hope someone can help me, I tried many times but not working, I want to order by default that featured all = yes be the first.
the builder I created the column featured with property sortable
This will be the home of my web but always displays first featured = no.
Any Idea?
The administrator has disabled public write access.

How to setup default order in grid 19 Aug 2013 21:32 #10847

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Did you found your answer ?

EDIT : The solution below :

use the states vars.
in your concerned view :
$model->setState('list.ordering', 'a.yourfield');
$model->setState('list.direction', 'desc');
Coding is now a piece of cake
Last Edit: 19 Aug 2013 21:34 by admin.
The administrator has disabled public write access.

How to setup default order in grid 19 Aug 2013 21:39 #10848

  • pinochet
  • pinochet's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Karma: 0
No, can you help me?
The administrator has disabled public write access.

How to setup default order in grid 19 Aug 2013 21:43 #10850

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Did you saw ?
I have edited and answered to you.
Coding is now a piece of cake
The administrator has disabled public write access.

How to setup default order in grid 19 Aug 2013 23:01 #10859

  • pinochet
  • pinochet's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Karma: 0
sorry did not see it, thank you very much, I hope I have caused you discomfort.
The administrator has disabled public write access.
Time to create page: 0.064 seconds

Get Started