ExtJs 4 Formpanel progress bar (wait mask) gray mask not properly hidden bugs

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.