Hi,
My early days of Yii. Have searched and can't find any clues on this hence post. I have modified the admin.php layout to lookup values from a couple of related tables as follows
This is great and all works ... apart from the fact that the filter fields are still looking up the numerical values rather than the text values (e.g. I want to filter on a text 'description' rather than the UID that represents that description).
How do I go about changing this?
Thanks
My early days of Yii. Have searched and can't find any clues on this hence post. I have modified the admin.php layout to lookup values from a couple of related tables as follows
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'silo-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'id',
array(
'name'=>'silo_id',
'value'=>'$data->silo->name',
'header'=>'Parent',
),
'name',
array(
'name'=>'silo_type',
'value'=>'$data->siloType?$data->siloType->type:"no silo type"',
),
array(
'class'=>'CButtonColumn',
),
),
)); ?>This is great and all works ... apart from the fact that the filter fields are still looking up the numerical values rather than the text values (e.g. I want to filter on a text 'description' rather than the UID that represents that description).
How do I go about changing this?
Thanks