Is there a reason why the bootstrap modal will not open when there are scrollbars?
Here is my code:
<div id="modal-placeholder"></div>
<script id="rowtemplate" type="text/x-template">
<tr>
<td>
${firstName}
</td>
<td>
${lastName}
</td>
<td>
${email}
</td>
<td>
${homePhone}
</td>
<td>
${cellPhone}
</td>
<td>
${workPhone}
</td>
<td>
${currentStatus}
</td>
<td>
<ul class="navbar-nav align-items-center d-none d-md-flex">
<li class="nav-item dropdown">
<a class="nav-link pr-0" rel='nofollow' href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<div class="media align-items-center">
<div class="media-body ml-2 d-none d-lg-block">
<img src="../images/3dotsicon_36x14.svg" />
</div>
</div>
</a>
<div class="dropdown-menu dropdown-menu-arrow dropdown-menu-right">
<div class=" dropdown-header">
</div>
<button type="button" class="dropdown-item" data-toggle="ajax-modal" data-target="#edit-client" data-url="/Home/EditClient/${id}" title="Edit">Edit</button>
<button type="button" class="dropdown-item" data-toggle="ajax-modal" data-target="#inactivateClient" data-url="/Home/Inactivate/${id}" title="Inactivate Client">Inactivate</button>
<button type="button" class="dropdown-item" data-toggle="ajax-modal" data-target="#add-comment" data-url="/Home/AddComment/${id}" title="Add Comment">Add Comment</button>
<button type="button" class="dropdown-item" data-toggle="ajax-modal" data-target="#send-message" data-url="/Home/SendMessage/${id}" title="Send Message">Send Message</button>
</div>
</li>
</ul>
</td>
</tr>
</script>
<ejs-grid id="Grid" class="table table-striped" dataSource="@Model" rowTemplate="#rowtemplate" allowPaging="true" allowSorting="true" allowExcelExport="true" toolbarClick="toolbarClick" toolbar="@(new List<string>() {"ExcelExport", "Search" })">
<e-grid-searchSettings fields="@(new string[] { "lastName"})" operator="contains" ignoreCase="true"></e-grid-searchSettings>
<e-grid-editSettings allowAdding="false" allowDeleting="false" allowEditing="false" mode="Normal"></e-grid-editSettings>
<e-grid-columns>
<e-grid-column headerText="First Name" width="125"></e-grid-column>
<e-grid-column headerText="Last Name" width="120"></e-grid-column>
<e-grid-column headerText="Email" width="120"></e-grid-column>
<e-grid-column headerText="Home Phone" width="120"></e-grid-column>
<e-grid-column headerText="Cell Phone" width="120"></e-grid-column>
<e-grid-column headerText="Work Phone" width="120"></e-grid-column>
<e-grid-column headerText="Status" width="120"></e-grid-column>
<e-grid-column headerText="" width="50"></e-grid-column>
</e-grid-columns>
</ejs-grid>
<script>
$(function () {
var placeholderElement = $('#modal-placeholder');
/// Check if Follow-Up is checked
var isFollowUp = $('#isFollowUp');
$('button[data-toggle="ajax-modal"]').click(function (event) {
var url = $(this).data('url');
$.get(url).done(function (data) {
placeholderElement.html(data);
placeholderElement.find('.modal').modal('show');
});
});
placeholderElement.on('click', '[data-save="modal"]', function (event) {
event.preventDefault();
var form = $(this).parents('.modal').find('form');
var actionUrl = form.attr('action');
var dataToSend = new FormData(form.get(0));
$.ajax({ url: actionUrl, method: 'post', data: dataToSend, processData: false, contentType: false }).done(function (data) {
var newBody = $('.modal-body', data);
placeholderElement.find('.modal-body').replaceWith(newBody);
var html = $($.parseHTML(data));
var isValid = html.find('[name="IsValid"]').val() == 'True';
if (isValid) {
placeholderElement.find('.modal').modal('hide');
location.reload();
//Change from reload to update the section of code
}
else {
/// Check if Follow-Up is checked
var isFollowUp = $('#isFollowUp');
if ($(isFollowUp).is(":checked")) {
$("#followUpInfo").show();
} else {
$("#followUpInfo").hide();
}
}
});
});
});
</script>