Yii Framework Forum: Complex pagination and sort - Yii Framework Forum

Jump to content

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

Complex pagination and sort Rate Topic: -----

#1 User is offline   spamec 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 19-February 09

Posted 15 January 2010 - 04:25 AM

Hi,

Got this little task today... I have to list and paginate by two models in one list (these models share five fields, which will be displayed in one table).
0

#2 User is offline   spamec 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 19-February 09

Posted 19 January 2010 - 06:26 AM

Maybe model based on mysql view would handle that? Anyone? :)
0

#3 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,906
  • Joined: 04-October 08
  • Location:DC, USA

Posted 19 January 2010 - 12:12 PM

Are there any relationship between the two tables?
0

#4 User is offline   spamec 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 19-February 09

Posted 19 January 2010 - 02:58 PM

Nope, these are something like Issue and Task tables, which share some fields and should be listed in one table. I'm aware of the fact, that it's not direct Yii question.
0

#5 User is offline   spamec 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 19-February 09

Posted 22 January 2010 - 04:19 AM

bump?
0

#6 User is offline   Onman 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 175
  • Joined: 26-December 09
  • Location:The Netherlands

Posted 22 January 2010 - 05:02 AM

You may need to develop a view class (like a database view, not Yii's view) like:
class CombinedModel extends CModel {...}
But there'd be a whole lot of redevelopment for the findXXX(), count(), setXXX() (and other similar) methods.
But Yii and its community would be greatful if you could share the result :-)
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