0
A
回答
2
试试这个, 插入
use yii\helpers\Url;
use yii\bootstrap\Modal;
进入u'r的index.php
[
'class' => 'yii\grid\ActionColumn',
'header' => 'Action',
'template' => '{view} {update} {delete} {your_link}',
'buttons' => [
'your_link' => function ($url, $model) {
$url = Url::to(['controller/action', 'id' => $model->id]);
return Html::a(' <span class="glyphicon glyphicon-eye-open" title = "Tooltip Name" ></span> ', 'javascript:void(0)', ['class' => 'anyClassName', 'value' => $url]);
},
],
],
定义模态并将此JS注册到you'r索引文件中
<?php
Modal::begin([
'id' => "modal",
'header' => '<h3>Assign Farmers to other Farm Mitra</h3>',
]);
echo "<div id='modalContent'></div>";
Modal::end();
$this->registerJs(
"$(document).on('ready pjax:success', function() {
$('.list').click(function(e){
e.preventDefault(); //for prevent default behavior of <a> tag.
$('#modal').modal('show').find('#modalContent').load($(this).attr('value'));
});
});
");
?>
相关问题
- 1. 显示在Yii2弹出GridView
- 2. 问题与模态弹出和下载的GridView
- 3. 模型弹出窗口中的Gridview
- 4. 从GridView LinkButton弹出的XML点击
- 5. 与弹出
- 6. 弹出与jquerymobile
- 7. 弹出与PHP
- 8. gridview列弹出窗口使用jquery
- 9. open on gridview按钮点击弹出
- 10. gridview单元格悬停弹出
- 11. asp.net gridview编辑模式弹出日历
- 12. 弹出与引导
- 13. 与确认弹出
- 14. 在弹出的对话框/窗口中打开GridView中包含的GridView
- 15. 弹出与R中的传单时弹出?
- 16. 出口问题与GridView的复选框
- 17. Flex弹出的HTML弹出
- 18. NSStatusItem与弹出式菜单
- 19. TinyMCE弹出与jquery加载
- 20. 弹出与点击按钮
- 21. 弹出框与计时器
- 22. 动态jQuery与PHP弹出
- 23. 问题与弹出()和append()
- 24. 模式弹出与partialview
- 25. 哪里最好放置在一个GridView的模式弹出
- 26. 弹出一个gridview中的更多细节?
- 27. 如何编辑模态弹出窗口内的gridview?
- 28. JSON.NET与GridView的
- 29. 与GridView的
- 30. 在CustomControl中弹出ToggleButton与弹出窗口
使用引导模式。 [阅读此](http://stackoverflow.com/questions/28470166/yii2-modal-dialog-on-gridview-view-and-update-button-shows-same-content-for-both)。 –