Reputation: 2063
Q : how to display CJuiDialog when click button of cgridview?
I would like to display the popup when user click the button of cgridview.
This is the button of cgridview
'buttons'=>array(
'history'=>array(
'visible'=>'Yii::app()->user->checkAccess("Reviewer") && $data->status == "Reviewing"',
'url'=>'Yii::app()->createUrl("/history/view", array("id"=>$data->id))',
'imageUrl'=>Yii::app()->request->baseUrl.'/images/assets/history.png',
),
But I'm really don't know how to do it. pls help me.
Upvotes: 0
Views: 2628
Reputation: 739
First you setup the CJuiDialog:
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'mydialog',
// additional javascript options for the dialog plugin
'options'=>array(
'title'=>'Dialog box 1',
'autoOpen'=>false,
),
));
echo 'dialog content here';
$this->endWidget('zii.widgets.jui.CJuiDialog');
Then you use the element 'click' of $buttons:
'click'=>'$("#mydialog").dialog("open"); return false;',
Upvotes: 2