Home  >  Article  >  Web Front-end  >  Two convenient ways to implement progress bars in Extjs_extjs

Two convenient ways to implement progress bars in Extjs_extjs

WBOY
WBOYOriginal
2016-05-16 17:21:141046browse

When developing Extjs, it often takes a period of time for the background program to be executed before the results are returned. Adding a progress bar can improve customer experience. The following are two convenient ways:

1. Use Ext.Msg before submitting data. .wait('Prompt', 'Data is being processed, please wait'); The waiting bar will pop up. After the data is processed successfully, use Ext.Msg.hide(); to remove the waiting, for example:
Ext.Msg.wait( 'Prompt', 'Data is being processed, please wait');

Copy code The code is as follows:

Ext.Ajax.request({
url:'DataAction.ashx?method=update',
params:{ItemCode:ItemCode,ItemName:ItemName},
callback:function(options,success ,response){
if(success==true)
{
Ext.Msg.hide();
Ext.Msg.alert('Prompt', 'The modification was successful. ');
}else{
alert(response.responseText);
}
}
})

2. If you are submitting a form, it is easier. Well, just configure waitMsg. The waiting prompt will disappear by itself after the data is processed, for example:
Copy the code The code is as follows:

BaseInfo.getForm().submit({
waitMsg:'Saving data, please wait.',
waitTitle:'Prompt',
method:'POST ',
url:'BaseMessageAction.ashx?method=modity',
params:{ItemCode:ItemCode,ItemName:ItemName},
success:function(form,action){
}
})
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn