Yii Framework Forum: Come filtrare il model da passare ad un CGridView? - Yii Framework Forum

Jump to content

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

Come filtrare il model da passare ad un CGridView? Rate Topic: -----

#1 User is offline   sensorario 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,986
  • Joined: 07-September 10
  • Location:Cesena (Italy)

Posted 26 January 2011 - 10:14 AM

Scusate la banalità della domanda ma ... come posso modificare il model di questo CGridView? A me in particolare, mi serve di selezionare tutti i record in cui il campo 'x' sia uguale ad un valore 'y'.

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'associa-commessa-acontabilita-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'commessa.descrizione',
		'codice_contabilita',
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>

0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,346
  • Joined: 12-October 09
  • Location:Croatia

Posted 26 January 2011 - 12:15 PM

I dati che CGridView mostra li riceve da $model->search()--- e li che devi fare le tue condizioni...
Find more about me.... btw. Do you know your WAN IP?
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