My Requirement:
Problem is When I click on submit button it executes below code but doesn't show progress bar immediately and also progress bar is hiding simultaneously with Extjs Message Alert box
function submit() {
jQuery("#myProgressBar").show();
Ext.Message.Alert(doAjaxCall());
}
function doAjaxCall() {
var ajaxResult = null;
jQuery.ajax({
url: someUrl,
data: someData,
success: function(result) {
task.delay(1000);
ajaxResult = result;
}
});
return ajaxResult;
}
If I use below piece of code then only it is showing progress bar otherwise it is not showing progress bar
var task= new Ext.util.DelayedTask(function() {
jQuery("#myProgressBar").hide();
});
and task.delay(1000);
in Ajax call success part
try this
function submit() {
jQuery("#myProgressBar").show();
doAjaxCall(aftersuccess);
}
function doAjaxCall(callback) {
var ajaxResult = null;
jQuery.ajax({
url: someUrl,
data: someData,
success: function(result) {
callback(result);
}
});
return result;
}
function aftersuccess(data){
jQuery("#myProgressBar").hide();
alert(data);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.