问题
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">×</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