Yii Framework Forum: One Dataprovider For Many Cgridview - Yii Framework Forum

Jump to content

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

One Dataprovider For Many Cgridview Rate Topic: -----

#1 User is offline   cyanatide 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 10-August 11

Posted 02 April 2013 - 04:16 AM

Hi!
For a customer, I have many business including many product. To limit connection to my database, I generate a dataprovider (with CSqlDataProvider) to get all my businesses. After that, I would like to create one CgridView per business code.
Is it possible to add a condition in a Cgridview (I want to display my dataprovider where businessCode='XXXX') or should I create one dataprovider by cgridview?
Thanks!
0

#2 User is offline   Ghanshyam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 18-March 13
  • Location:Ahmedabad

Posted 02 April 2013 - 04:21 AM

You can try
'value'=>'($data->gender=="M")?"Male":"Female"',

0

#3 User is offline   cyanatide 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 10-August 11

Posted 02 April 2013 - 05:07 AM

You give me a solution to create a condition on a cell. I would like to create a condition on a line: if this line deal about business XXXX, i display it in my Cgridview, if not, this line is not displayed.
0

#4 User is offline   cyanatide 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 10-August 11

Posted 03 April 2013 - 01:55 AM

bump
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