Yii Framework Forum: [Solved] i have a problem with CGridView - Yii Framework Forum

Jump to content

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

[Solved] i have a problem with CGridView Rate Topic: -----

#1 User is offline   naser 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 85
  • Joined: 30-October 09
  • Location:tehran - Iran

Posted 04 July 2010 - 06:43 AM

it's my code (gii's code) ::)

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'comment-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'id',
		'name',
		'email',
		'website',
		'content',
        'status',
		array(
		  'dataField'=>'status',
		  'dataExpression'=>'($model->status==1) ? "fgi":"sdfsdf"',
		),
		/*
		'post_id',
		*/
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>


i just added this line
		array(
		  'dataField'=>'status',
		  'dataExpression'=>'($model->status==1) ? "fgi":"sdfsdf"',
		),


but when i run script, i get this error

Property "CDataColumn.dataField" is not defined.
0

#2 User is offline   Maurizio Domba Cerin 

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

Posted 04 July 2010 - 07:22 AM

have you checked the documentation for CDataColumn... there is no dataField or dataExpression... but there are name and value that you can use...

Check here - http://www.yiiframew...api/CDataColumn
Find more about me.... btw. Do you know your WAN IP?
0

#3 User is offline   naser 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 85
  • Joined: 30-October 09
  • Location:tehran - Iran

Posted 04 July 2010 - 09:25 AM

i have used Yii v1.1rc Class Reference

and there was dataField but i changed dataField to name and it's working

tnx
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