First you must know the exception two methods Ext.MessageBox.hide () and Ext.MessageBox.updateProgress (value, "Progresstext", "MSG") (three parameters, see name to know meaning),
Note the number between value 0-1, which indicates the progress of the progress bar.
First: (Control progress by the size of the progress, full progress is 1)
Code
The code is as follows |
Copy Code |
function Read4 () { var progressbar=ext.msg.show ({ Title: "Caption", Msg: "Control progress by the size of the progress", Progress:true, width:300 }); var count=0; var bartext= ""; var curnum=0; Ext.TaskMgr.start ({ Run:function () { count++; if (count>=10) { Progressbar.hide (); } CURNUM=COUNT/10; bartext=curnum*100+ "%"; Progressbar.updateprogress (Curnum,bartext); }, interval:1000 }) } |
Second: (through fixed-time control of progress loading)
Code
Code
The code is as follows |
Copy Code |
function Read5 () { var progressbar=ext.msg.show ({ Title: "Caption", Msg: "Complete Progress by fixed time", WIDTH:300, Wait:true, Waitconfig:{interval:500,duration:5000,fn:function () { Ext.Msg.hide (); }}, Closable:true }); settimeout (function () { Ext.Msg.hide (); },5000); } |
Dynamic Update progress Information
It looks good up there. But in the example application I found that waiting for the progress bar (wait mask) gray mask can not hide the bug, I modified the example below
The code is as follows |
Copy Code |
Ext.define (' Ext.form.SubmitFix ', { Override: ' Ext.zindexmanager ',
Register:function (comp) { var me = this, Compafterhide = Comp.afterhide;
if (Comp.zindexmanager) { Comp.zIndexManager.unregister (comp); } Comp.zindexmanager = Me;
Me.list[comp.id] = comp; Me.zIndexStack.push (comp);
Hook into Component ' s afterhide processing Comp.afterhide = function () { Compafterhide.apply (comp, arguments); Me.oncomponenthide (comp); }; },
/** * Unregisters a {@link ext.component} from this zindexmanager. This should is not * need to be called. Components are automatically unregistered upon destruction. * The {@link #register}. * @param {ext.component} comp the Component to unregister. */ Unregister:function (comp) { var me = this, list = Me.list;
Delete Comp.zindexmanager; if (list && list[comp.id]) { Delete List[comp.id];
Relinquish control of Component ' s afterhide processing Delete comp.afterhide; Ext.Array.remove (Me.zindexstack, comp);
Destruction requires that the topmost visible floater to be activated. Same as hiding. Me._activatelast (); } } }); |
The bug is fixed in version 4.1.2, and the way to fix it in advance is to add the following patch code to the project: