LiliGoncalves
New Coder
Good morning,
I use javascript a few times and when I use it, it's almost always for the same.
But this time I need to block the page while the event (which takes a long time) takes place.
In the searches I found jquery.blockUI, I identify it in the HTML as "selectVersionId"
and then in the treatment
The blocking happens but doesn't go to function "url: 'GetVersionId'" and stalls at blockUI!!
What am I doing wrong?
Thanks
I use javascript a few times and when I use it, it's almost always for the same.
But this time I need to block the page while the event (which takes a long time) takes place.
In the searches I found jquery.blockUI, I identify it in the HTML as "selectVersionId"
HTML:
@Html.DropDownListFor(m => m.VersionId, this.Model.versions, new { @class = "form-control", @Id = "selectVersionId" })
and then in the treatment
JavaScript:
$(document).ajaxStop($.unblockUI);
$('#selectVersionId').change(function () {
$.blockUI({ message: '<h1><img src="../assets/img/loading_icon.gif" /> Just a moment...</h1>' });
test();
});
function test() {
/* Get the selected value of dropdownlist */
var StrDock = $('#IdDock').val();
var selectedID = $(this).val();
if (selectedID && selectedID != '') {
$.ajax({
url: 'GetDonglesByVersionId',
type: 'GET',
cache: false,
data: { versionId: selectedID, dockSearch: StrDock },
}).done(function (result) {
$('body').html(result);
});
}
$("#selectVersionId").trigger("change");
}
The blocking happens but doesn't go to function "url: 'GetVersionId'" and stalls at blockUI!!
What am I doing wrong?
Thanks