hshu
7 Aug 2012, 10:53 AM
Hello Ext gurus!
I have a window displaying the number of things I have access to.
But if that number is 0, I need to hide the window.
A pseudo looks like this:
myDialog.show();
if (getNum() === 0) {
myDialog.hide();
}
That code won't work. It leaves a transparent window remainder behind. Because you try to call hide() before show() finishes animation.
I have a hacky fix:
myDialog.show();
if (getNum() === 0) {
Ext.defer(myDialog.hide, 1, myDialog);
}
Is there any better way? By the way, myDialog.rendered is already true by the time you call hide()
Thanks!
I have a window displaying the number of things I have access to.
But if that number is 0, I need to hide the window.
A pseudo looks like this:
myDialog.show();
if (getNum() === 0) {
myDialog.hide();
}
That code won't work. It leaves a transparent window remainder behind. Because you try to call hide() before show() finishes animation.
I have a hacky fix:
myDialog.show();
if (getNum() === 0) {
Ext.defer(myDialog.hide, 1, myDialog);
}
Is there any better way? By the way, myDialog.rendered is already true by the time you call hide()
Thanks!