$this->widget('bootstrap.widgets.TbExtendedGridView', array( 'type'=>'bordered', 'dataProvider'=>$model->search(), 'filter'=>$model, 'template'=>"{items}", 'columns'=>array( 'id', 'firstName', 'lastName', 'language', 'hours', array( 'header'=>'Options', 'class'=>'bootstrap.widgets.TbButtonColumn', 'buttons'=>array( 'view'=> array( 'url'=>'Yii::app()->createUrl("person/view", array("id"=>$data->id))', 'options'=>array( 'ajax'=>array( 'type'=>'POST', 'url'=>"js:$(this).attr('href')", 'success'=>'function(data) { $("#viewModal .modal-body p").html(data); $("#viewModal").modal(); }' ), ), ), ), ) ))); ?> beginWidget('bootstrap.widgets.TbModal', array('id'=>'viewModal')); ?>code ในส่วนของ action view ใน controllerView Employee Details
Employee DetailsendWidget(); ?>
public function actionView($id) { if( Yii::app()->request->isAjaxRequest ) { $this->renderPartial('view',array( 'model'=>$this->loadModel($id), ), false, true); } else { $this->render('view',array( 'model'=>$this->loadModel($id), )); } }อ้างอิง http://stackoverflow.com/questions/14152453/how-can-i-make-a-gridview-in-yii-booster-bootstrap-widget-with-popups-for-button
ไม่มีความคิดเห็น:
แสดงความคิดเห็น