Answer the question
In order to leave comments, you need to log in
Yii bootstrap modal windows?
I am using bootstrap.
there is such a great development as a modal window
in tbgridview
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>
Answer the question
In order to leave comments, you need to log in
index
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),
));
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question