So you want a modal to show your CGridView data through clicking on the admin button?
In you Button View Paste this code:
'senderscore'=>array(
'imageUrl'=>Yii::app()->request->baseUrl.'/images/loginhistory.PNG',array("style"=>"width:16px;height:16px;"),
//'url'=>'Yii::app()->createUrl("ipSenderScore/view/", array("id"=>$data->id,"asDialog"=>1))',
'url'=>'Yii::app()->createUrl("ipSenderScore/admin",array("ip_id"=>$data->id))',
'options'=>array(
'ajax'=>array(
'type'=>'POST',
// ajax post will use 'url' specified above
'url'=>"js:$(this).attr('href')",
'update'=>'#id_view',
),
),
),
After closing the widgets , paste this dive cod in your current admin view:
<div id="id_view" style="display:none;"></div>
In your ipSenderScore controller,
public function actionAdmin()
{
// your model code
$this->render('admin',array('model'=>$model,));
}
In your views/ipSenderScore/admin.php paste at the top this zii widget code:
<?php
//------------ add the CJuiDialog widget -----------------
$this->beginWidget('zii.widgets.jui.CJuiDialog', array( // the dialog
'id'=>'dlg-address-view',
'options'=>array(
'title'=>'View Address #'. $model->id,
'autoOpen'=>true,
'modal'=>true,
'width'=>550,
'height'=>470,
),
));
//-------- default code starts here ------------------
?>
<?php $this->widget('zii.widgets.grid.CGridView', array(
// your all cgrid view original code paste here
and in the end of page close widget: endWidget('zii.widgets.jui.CJuiDialog'); ?>
Its working for me. =:)