Problem With Search/view Information

I am new to yii and I have a screen that displays all columns in a table. One of the columns is defined as boolean. When the screen is displayed the boolean column always display "Yes". Even when the search feature is selected it lists the correct number of rows but the colum displays "Yes".

Here is the code in the view admin file:

<?php $this->widget(‘bootstrap.widgets.TbGridView’,array(

'id'=&gt;'server-grid',


'dataProvider'=&gt;&#036;gridDataProvider,


'filter'=&gt;&#036;model,


'type'=&gt;'striped bordered condensed',


'columns'=&gt;array(


	'id',


	array(


	     'name' =&gt; 'virtual_machine',


	     'value' =&gt; '(&#036;data-&gt;virtual_machine === 0) ? Yii::t(&#092;'app&#092;', &#092;'No&#092;') : Yii::t(&#092;'app&#092;', &#092;'Yes&#092;')',


	     'filter' =&gt; array('0' =&gt; Yii::t('app', 'No'), '1' =&gt; Yii::t('app', 'Yes')),


				),


	'note',


	array(


		'class'=&gt;'bootstrap.widgets.TbButtonColumn',


	),


),

)); ?>

The model file under rules defines the virtual_machine as integerOnly… this code is generated should this not be boolean?

model code:

public function rules() {


	return array(


		array('virtual_machine', 'required'),


		array('virtual_machine, 'numerical', 'integerOnly'=&gt;true),


		array('note', 'safe'),


		array('id, virtual_machine, note', 'safe', 'on'=&gt;'search'),


	);


}

Can anyone explain what is wrong?

Thanks

Dear Friend,

Kindly check whether the following is helpful.

Replace the identical(===) operator with equal(==) operator.




array(

'name' => 'virtual_machine',

'value' => '($data->virtual_machine == 0) ? Yii::t(\'app\', \'No\') : Yii::t(\'app\', \'Yes\')',

'filter' => array('0' => Yii::t('app', 'No'), '1' => Yii::t('app', 'Yes')),

),




you can change it other way around swap your values and see something as following




 'filter'=>array(1=>'Yes', 0=>'No'),

 'value'=>'($data->virtual_machine==1)?("Yes")<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/sad.gif' class='bbc_emoticon' alt=':(' />"No")',

also check your database if your data is getting saved

Replaced the === with == and that fixed the problem.

Thank you