Yii Framework Forum: How To Get Issue Type In Admin Page? - Yii Framework Forum

Jump to content

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

How To Get Issue Type In Admin Page?

#1 User is offline   Xavier John 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 16-August 13
  • Location:Redmond, WA

Posted 26 August 2013 - 10:35 PM

Hi,
On page 89, there is talk about converting the type_id to show the actual string in a drop down.

<?php echo $form->dropDownList($model,'type_id', $model->getTypeOptions()); ?>


How to get the admin.php to show the Text instead of the type_id in the grid?
0

#2 User is offline   Xavier John 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 16-August 13
  • Location:Redmond, WA

Posted 26 August 2013 - 10:42 PM

Here is a solution I found
$this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider' => $socialChannelDataProvider,
    'columns' => array(
	'name',
	'description',
        array(
            'name' => 'type_id',
            'value' =>'$data->getTypeOptions()'
        ),
    ),
));

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