drfrvbq736383 2016-04-23 09:22
浏览 77
已采纳

通过在yii2中使用javascript单击按钮来显示或隐藏任何表单

How to display the form when I click on Gridview button?

Basically I want to populate one form which includes the drop down and submit button in it.

By clicking on button I want to populate the form in popup box.

'panel' => [
        'type' => 'info',
        'after' => Html::button('<i class="glyphicon glyphicon-plus"></i>&nbsp;Allocate', [ 'id' => 'modalButton', 'class' => 'btn btn-success'),
        'showFooter' => false,
  • 写回答

1条回答 默认 最新

  • doudu22272099831 2016-06-23 07:14
    关注

    Used following code and resolved my issue.

     $this->registerJs("$(function() {
           $('#popupModal').click(function(e) {
             e.preventDefault();
             $('#modal').modal('show').find('.modal-content')
             .load($(this).attr('href'));
           });
        });");
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?