[英]show or hide any forms by clicking a button using javascript in yii2
當我單擊Gridview按鈕時如何顯示表單?
基本上,我想填充一種包含下拉菜單和“提交”按鈕的表單。
通過單擊按鈕,我想在彈出框中填充表格。
'panel' => [
'type' => 'info',
'after' => Html::button('<i class="glyphicon glyphicon-plus"></i> Allocate', [ 'id' => 'modalButton', 'class' => 'btn btn-success'),
'showFooter' => false,
使用以下代碼並解決了我的問題。
$this->registerJs("$(function() {
$('#popupModal').click(function(e) {
e.preventDefault();
$('#modal').modal('show').find('.modal-content')
.load($(this).attr('href'));
});
});");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.