tangyuan
给你个例子:
'class' => 'yii\grid\ActionColumn', 'header'=>'<a href="#">操作</a>', 'template' => '{updaterule}', 'buttons' => [ 'updaterule'=>function($url, $model){ return Html::tag('span',"", [ 'class'=>"fa fa-wrench", 'style'=>'cursor:pointer', 'title' => Yii::t('yii', 'Edit'), 'data-toggle'=>"modal", 'data-target'=>"#**mymodal**"//自己定义的弹出层 ]); },
弹出层
<div class="modal" id="**mymodal**" tabindex="-1" role="dialog" aria-labelledby="GuestModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header">
id名称相同,,bootstrap会自己调用
bootstrap.min.js引入了吗
给你个例子:
'class' => 'yii\grid\ActionColumn', 'header'=>'<a href="#">操作</a>', 'template' => '{updaterule}', 'buttons' => [ 'updaterule'=>function($url, $model){ return Html::tag('span',"", [ 'class'=>"fa fa-wrench", 'style'=>'cursor:pointer', 'title' => Yii::t('yii', 'Edit'), 'data-toggle'=>"modal", 'data-target'=>"#**mymodal**"//自己定义的弹出层 ]); },
弹出层
<div class="modal" id="**mymodal**" tabindex="-1" role="dialog" aria-labelledby="GuestModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header">
id名称相同,,bootstrap会自己调用
$(".要点击的按钮").click(function(){ $('#myModal').modal('show'); }); //确定按钮 $(".确定按钮").click(function(){ $('#myModal').modal('hide'); })
- tangyuan 回答了问题 yii弹出层插件怎么用
给你个例子:
'class' => 'yii\grid\ActionColumn', 'header'=>'<a href="#">操作</a>', 'template' => '{updaterule}', 'buttons' => [ 'updaterule'=>function($url, $model){ return Html::tag('span',"", [ 'class'=>"fa fa-wrench", 'style'=>'cursor:pointer', 'title' => Yii::t('yii', 'Edit'), 'data-toggle'=>"modal", 'data-target'=>"#**mymodal**"//自己定义的弹出层 ]); },
弹出层
<div class="modal" id="**mymodal**" tabindex="-1" role="dialog" aria-labelledby="GuestModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header">
id名称相同,,bootstrap会自己调用
内容如下: <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> 弹出框 </button> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="myModalLabel">提示信息</h4> </div> <div class="modal-body"> 自己的内容 </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> <button type="button" class="btn btn-primary">保存</button> </div> </div> </div> </div>
就像这种 很容易自己写出来了 样式的话 只要你项目引入了bootstrap.js就可以了
为什么会叠加呢 再说不是一般都会指定action吗
- tangyuan 评论了源码 回到顶部最简单的JQuery实现代码
收藏啦······
- tangyuan 评论了源码 Configuration配置
嗯 感觉挺不错的