Hi All,
I am trying to use Zii widgets and I must say that using them saves a lot of effort .But I am stuck in a strange problem this time.
I have a custom function in my model that returns a string from my database on behalf of id.
I have successfully used it in CDetailView
<?php
$this->widget(‘zii.widgets.CDetailView’, array(
'data'=>$model,
'attributes'=>array(
'strDivisionName',
array(
'label'=>$model->getAttributeLabel('intZone_Id'),
'value' =>$model->ZoneName,
)
),
'htmlOptions'=>array('class'=>'question-answer'),
)); ?>
and it is working fine
It shows the Zone Name in place of Zone id(This is the functionality which I need)
I am trying to do the same with CgridView
<?php
$this->widget(‘zii.widgets.grid.CGridView’, array(
'id'=>'division-grid',
'dataProvider'=>$model->search(),
'columns'=>array(
'strDivisionName',
array(
'name'=>$model->getAttributeLabel('intZone_Id'),
'type'=>'raw',
'value'=>$model->ZoneName
),
array(
'class'=>'CButtonColumn',
'template'=>'{view}{update}'
),
),
)); ?>
Here the label is coming up fine but value is not coming.It is coming as blank. I must be missing a very obvious point here.
Any help is highly appreciated…
Regards