Dear Daniel,
After looking at the code you I saw a couple of mistakes. Here is the correct solution to all of them
// you forgot to get Account Model page instead of News_page <-- that was my example
$page = Yii::app()->getRequest()->getParam('Account_page',false); // corrected now
// you forgot to include the CButtonColumn declaration
// here the correct way
// setting up the class
$buttons = array('class'=>'CButtonColumn');
// do we have a Account_page parameter?
$page = Yii::app()->getRequest()->getParam('Account_page',false);
// if yes, modify the link
if( $page ){
foreach(array('view','update','delete') as $id){
$buttons[$id.'ButtonUrl'] = 'Yii::app()->controller->createUrl("'.$id.'",array("id"=>$data->primaryKey,"Account_page"=>'.$page.'));';
}
}
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'account-grid',
'dataProvider'=>$dataProvider,
'selectableRows' => 2,
'ajaxUpdate'=>false, // doesnt matter but ok
'columns'=>array(
array(
'name'=>'AccountNo',
'type'=>'raw',
// here you put "page" as parameter, changed to "Account_page"
'value'=>'CHtml::link(CHtml::encode($data->AccountNo), array("view", "id"=>$data->ID, "Account_page"=>$dataProvider->pagination->currentPage ))',
'htmlOptions'=>array('style'=>'text-align: center; width: 60px;'),
),
'AccountName',
array(
'name'=>'Level',
'htmlOptions'=>array('style'=>'text-align: center; width: 50px;'),
),
array(
'name'=>'NormalBalance',
'htmlOptions'=>array('style'=>'text-align: center; width: 50px;'),
),
array(
'name'=>'Classification',
'type'=>'raw',
'value'=>'$data->Classification',
'htmlOptions'=>array('style'=>'text-align: left; width: 120px;'),
),
// we do not declare the buttons column outside, we declare the array
// that holds the declaration of the CButtonColumn and its buttons
// and then include them here
$buttons,
),
'pager'=>array('cssFile'=>false,
'header'=>'',
'firstPageLabel'=>'<<',
'prevPageLabel'=>'<',
'nextPageLabel'=>'>',
'lastPageLabel'=>'>>',
'maxButtonCount'=>5,
'class'=>'CLinkPager'),
'cssFile'=>false,
'template'=>'<div class="gridHeader">{pager}</div>{items}<div class="gridFooter">{summary}{pager}</div>',
));
Hope I help you Daniel,
Cheers!