In a asp.net mvc project, I use three button. When i click a button like "KOT" button, i want a pop up window. In pop up window want to save some data like Restaurant food order information. After click save button, pop up window don't hide and that saved data will show in the right side of that pop up window.
/* Index View */
@Html.ActionLink("KOT ", "ViewLyubomir", "Home", new { id = item.TableNo }, new { @class = "modal-link btn btn-primary btn-large" })
|
/* LayOut View */
<script type="text/javascript">
$(function () {
// Initialize numeric spinner input boxes
//$(".numeric-spinner").spinedit();
// Initalize modal dialog
// attach modal-container bootstrap attributes to links with .modal-link class.
// when a link is clicked with these attributes, bootstrap will display the href content in a modal dialog.
$('body').on('click', '.modal-link', function (e) {
e.preventDefault(true);
$(this).attr('data-target', '#modal-container');
$(this).attr('data-toggle', 'modal');
});
$('body').on('click', '.modal-Imam', function (e) {
e.preventDefault();
$(this).attr('data-target', '#modal-container');
$(this).attr('data-toggle', 'modal');
});
// Attach listener to .modal-close-btn's so that when the button is pressed the modal dialog disappears
$('body').on('click', '.modal-close-btn', function () {
$('#modal-container').modal('hide');
});
//clear modal cache, so that new content can be loaded
$('#modal-container').on('hidden.bs.modal', function () {
$(this).removeData('bs.modal');
});
$('#CancelModal').on('click', function () {
return false;
});
});
</script>
/* "KOT" partial view */
On the bottom of KOT i am using this script
<script type="text/javascript">
$(function () {
$('#approve-btn').click(function (e) {
$('#modal-container').modal('show');
e.preventDefault(true);
});
});
</script>
What I have tried:
when i click 'KOT' button pop up window come. but after click save button on pop up window, that going to be hide, I can not prevent this