array(
'class'=>'bootstrap.widgets.TbButtonColumn',
'template'=>'{view}',
'buttons'=>array
(
'view' => array
(
'url' => '$data->id."|".$data->parent_id',
'click' => 'function(){
data=$(this).attr("href").split("|")
$("#myModalHeader").html(data[1]);
$("#myModalBody").load("'.$this->createUrl('view').'&id="+data[0]+"&asModal=true");
$("#myModal").modal();
return false;
}',
),
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h4 id="myModalHeader">Modal header</h4>
</div>
<div class="modal-body" id="myModalBody">
<p>One fine body...</p>
<?= $data->date ?>
</div>
<div class="modal-footer">
<?php $this->widget(
'bootstrap.widgets.TbButton',
array(
'label' => 'Close',
'url' => '#',
'htmlOptions' => array('data-dismiss' => 'modal'),
)
); ?>
</div>
array(
'class' => 'bootstrap.widgets.TbButtonColumn',
'template' => '{view}',
'buttons' => array
(
'view' => array
(
//'url' => '$data->id."|".$data->parent_id',
'url' => '$data->id',
'click' => 'function(){
data=$(this).attr("href").split("|")
$("#myModalHeader").html(data[0]);
$("#myModalBody").load("' . $this->createUrl('modalView') . '/"+data[0]+"");
$("#myModal").modal();
return false;
}',
),
)
),
),
));
?>
public function actionModalView($id)
{
$this->renderPartial('view', array(
'model' => $this->loadModel($id),
));
}