Hi!
I’m a newbie in Yii trying to make something that seems quite basic, but I can’t figure out how should I do it.
I have a view with a grid that shows some data (‘zii.widgets.grid.CGridView’) and set of tabs (‘zii.widgets.jui.CJuiTabs’) that allow the user to select some operations to perform over data.
After the operation is selected I would like to show in the same view but in another grid the results of the operation to allow the user to compare both grids.
I’ve tried declaring the second grid inside another view (_viewrollup) and after the operation is performed the controller should ONLY render _viewrollup, but this is not working as expected (it shows the contents of _viewrollup but not inside the mani view.
This is the code of the main view
//operators tab
$this->widget('zii.widgets.jui.CJuiTabs',array(
'tabs'=>array(
'Roll up'=>$this->renderPartial('_view_rollupTab',array('dimensions'=>$dimensions, 'model'=>$rollup),true),
'Slice'=>$this->renderPartial('_view_sliceTab',array(),true),
'Dice'=>$this->renderPartial('_view_diceTab',array(),true),
),
// additional javascript options for the tabs plugin
'options'=>array(
'collapsible'=>true,
),
'htmlOptions'=>array('class'=>'shadowtabs'),
));
?>
<h2>Base Facts</h2>
<?php
//base data grid
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider' => $cubeDataProvider
));
?>
<h2>Operation Results</h2>
<?php
//operation results grid
$this->render('_viewrollup',array(
'rollupDataProvider'=>NULL,
));
?>
This is the code of _viewrollup
<?php
if ( $rollupDataProvider){
//data grid
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider' => $rollupDataProvider
));
}
?>
And this is the code inside the controller
$this->render('_viewrollup',array(
'rollupDataProvider'=>$rollupDataProvider,
));
}
any help would be appreciated
thanks
Lorena