Reputation: 421
I have main view and partial view,
main view contains drop down for person's name. when I am choosing any specific person's name that time person's details are loading in partial view
when partial view is loading with person's details,I have to give checkbox for edit details when user clicks on checkbox ,I am loading edit view with bootstrap modal.
but when I submit edit form from modal that time when view is loading ,it is not scrolling and it is just loading partial view and not main view which contains dropdown
This is code for checkbox
<input type="checkbox" id="divchkBox" /> Update Details
This is ajax call for checkbox
$('#divchkBox').click(function () {
if ($(this).is(':checked')) {
$('#myModal').modal();
$('#divchkBox').prop('checked', false);
}
});
Thi is modal code
<div class="modal fade bd-example-modal-lg" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content" id='myModalContent'>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title heading" id="myModalLabel">Edit records</h4>
</div>
<form id="person">
<div class="modal-body">
some editable feilds..
</div>
</form>
<input type="submit" class="btn btn-primary searchbtn" value="Save changes" id="Edit_Person" />
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
This is ajax call when click on save changes button
$("#Edit_Person").on("click", function (e) {
$.ajax({
url: "some url",
data: $('#person').serialize(),
type: "Get",
dataType: "html",
success: function (result) {
$("#PartialView").html(result)
var $j = jQuery.noConflict();
},
});
});
where I need to change to load view with its main and partial view ? and it will be scrollable.
Modal and above ajax calls are in partial view.
Thank you in advance.
Upvotes: 0
Views: 659
Reputation: 1878
Please try the below code after $("#PartialView").html(result)
$('#myModal').modal('show');
Upvotes: 1