Yii Framework Forum: Sorting A Dataprovider - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Sorting A Dataprovider Rate Topic: -----

#1 User is offline   amlouk 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 15-July 12

Posted 10 October 2012 - 04:35 PM

Good evening friends
I'm wondering if there a way to sort a dataprovider by City...for instant if the user comes from new-york the topics about NY shows first then other topics and if he comes from California the topics about California comes first then other topics... etc
Thanks
http://ws-templates.com a website created with the yii framework
0

#2 User is offline   Gerhard Liebenberg 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 338
  • Joined: 07-January 12
  • Location:Stillbay - Western Cape - South Africa

Posted 10 October 2012 - 05:46 PM

Check this wiki: Dynamic Gridviews

See the last part of the searchIncludingPermissions function in the model. You can use it to sort the dataprovider on the default model's fields or on a related model's fields.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users