Hello
I want to render view.php (view of model) completely in CJuiDialog as a pop up.
(Not the Form) So many posts on this forum are about render form in the CJuiDialog. I didn’t get any post regarding how to render model view into CJuiDialog
I did some work that display the view into the dialog box,
Problem is, in index.php i have pagination to display 10 records per each page.
after going to next page views of all records render on the index page.
public function actionIndex()
{ $dataProvider=new CActiveDataProvider('Jobs',array(
/*'pagination'=>array(
'pageSize'=>8,
),*/));
$this->render('guestview',array(
'dataProvider'=>$dataProvider,
));
}
<?php
$target = 'window.location='."'".$this->createUrl('jobs/index')."'";
$dialogId = "dialog_{$data->job_id}";
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>$dialogId,
// additional javascript options for the dialog plugin
'options'=>array(
'title'=>$data->job_title,
'autoOpen'=>false,
'show'=>array(
'effect'=>'blind',
'duration'=>1000,
),
'hide'=>array(
'effect'=>'explode',
'duration'=>500,
),
'buttons' => array(
array('text'=>'Route','click'=> 'js:function(){'.$target.'}'),
array('text'=>'Cancel','click'=> 'js:function(){$(this).dialog("close");}'),
),
'height'=>500,
'width'=>450,
'show'=>'fade',
'hide'=>'fade',
),
));
//define the model
//$model=new Jobs;
echo CHtml::link(CHtml::encode(view),array('jobs/view','id'=> $data->job_id));
$this->renderPartial('/jobs/view',array('model'=>$data));
$this->endWidget('zii.widgets.jui.CJuiDialog');
?>
<div class="ca-item-main">
<img class="ca-images" src="<?php echo Yii::app()->baseUrl."/images/".$data->job_photo?>" label="<?php $data->job_photo?>"/>
<h4>
<!--<span class="ca-quote">“</span>-->
<span><?php echo CHtml::Link(CHtml::encode('Job-'.$data->job_id), '#', array('jobs/view','onclick'=>'$("#'. $dialogId .'").dialog("open"); return false;',));
?>
<?php //echo substr($data->job_desc,0,200)." ...."; ?>
</span>
</h4>
</div>