Jasny Bootstrap rowlink close modal is not closing?

限于喜欢 提交于 2019-12-24 05:02:12

问题


I am realy have problem with this Jasny Bootstrap rowlink modal not closing. I have import Bootstrap v 3.2.0.

There I have this table where I whant to have when you click on row modal with some data opens. So far this works, on row click modal opens, and show some data - BUT! when I close it, it doesn't close (modal is not closing).

Here is my intire code for table with modal:

<table class="table table-bordered table-striped table-hover">
  <thead>
    <tr>
      <th>Interna št.</th>
    </tr>
  </thead>
  <tbody data-link="row" class="rowlink">
  @if (Model.Spremenljivke != null)
  {
    i = 0;
    foreach (var row in Model.Spremenljivke)
    {
    <tr>
      <td>@row.Internal.First()
          <a href="#" data-toggle="modal" data-target="#myModal@(i)"/>
          <!-- Modal -->
          <div class="modal fade" id="myModal@(i)" 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"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                </div>
                  <div class="modal-body">
                    <div style="display: block">
                      <p class="pscript">
                        Interna št.: <b>@Html.Raw(row.Internal.First())</b>
                      </p>
                    </div>
                  </div>
                </div>
                <div class="modal-footer">
                  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
              </div>
            </div>
          </div>
        </td>                      
      </tr>
      {
        i = i + 1;
      }
    }
  }                      
  </tbody>
</table>

And in _Layout I have both css and js link to jasny bootstrap.

Realy thanks for any help


回答1:


You have one </div> too many, don't you? You are closing the modal-content div before the modal-footer. Hard to see because of indentation... I believe this could be the reason for the error.


Remove the fade class from the modal as it may sometimes cause issues.



来源:https://stackoverflow.com/questions/25257927/jasny-bootstrap-rowlink-close-modal-is-not-closing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!