Wednesday, 11 September 2013

How to use text in CGridview dropdownlist instead of values

How to use text in CGridview dropdownlist instead of values

I'm new to Yii. I have a gridview with search boxes. One of these search
boxes has to be replaced by dropdown list. Based on the dropdownlist value
the value in the gridview cells should be replaced.
Suppose, I use (0-> No Activity, 1->Pending, 2->Approved, 3-> Rejected). I
need to replace the values 0 with No Activity, 1 with Pending, 2 with
Approved, 3 with Rejected respectively both in Gridview cell and
dropdownlist.
What should I mention in the value of the array
array(
'name' => 'Test',
'value' =>
'filter' => array('0' => 'No Activity', '1' => 'Pending','2'
=> 'Approved', '3' => 'Rejected',''=>'All'),
'htmlOptions' => array('style' => 'width: 500px;'),
),
I'm using PHP 5.2 and Yii version 1.13

No comments:

Post a Comment