Hi!
I try to render two CGridView’s into one view:
<?php $this->renderPartial('/category/admin'); ?>
<?php $this->renderPartial('/products/admin'); ?>
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'category-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'title',
array(
'class'=>'CButtonColumn',
'template' => '{open}',
'buttons'=>
array('open' =>
array(
'label' => 'open',
'url' => 'Yii::app()->createUrl("/YiiShop/category/update", array("id" => $data->category_id))',
)
)
),
),
));
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'products-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'category_id',
'product_id',
'title',
'price',
'unit',
array(
'class'=>'CButtonColumn',
'buttons'=>array(
'label' => 'view',
'url' => array('products/view', 'id' => $data->id),
)
),
),
));
Sadly, the second CGridView lacks the whole CButtonColumn, no matter if i specify the ‘buttons’ array or doesn’t …
is the CButtonColumn intelligent enough to determine the link’s of {view}{update}{delete} depending on the dataProvider that’s give to the CGridView? If not: shouldn’t it be?