-
9 Aug 2012 1:01 AM #1
Unanswered: Mask working only the first time the window is shown
Unanswered: Mask working only the first time the window is shown
Hi,
i have a window with two buttons. One firing the action-event. The other firing the cancel-event.
On action data is sent to the server and the mask shows up. Works as expected.
The next time action fires the mask is not working anymore.
Any ideas?
Code:var window = Ext.widget('CustomWindow'); window.on({ 'action':function(e){ var form = Ext.get('SomeForm'); form.mask('something is going on......'); me.doSomething(id, e, function(data){ form.unmask(); callback(data); window.hide(); }); }, 'cancel':function(e){ window.close(); }, 'beforehide':function(e){ window.reset(); } }); window.show();
-
9 Aug 2012 1:49 AM #2
Where is your "SomeForm" located? What does window.reset() do? How do you open the window second time to do the action? It would be helpful if you post your related codes.
-
9 Aug 2012 2:01 AM #3
Thanks for fast reply.
This code is located in a controller method which is executed when a menu button is clicked.
Reset is a method to reset SomeForm located in the window.
-
9 Aug 2012 2:17 AM #4
1. No, I did not mean where this code is located. What's I mean is that where the 'SomeForm' is located? Is it inside or outside the window?
2. Does window.reset() destroy the window or it just reset the form?
As you said, this code is in a controller and is executed when user clicks an menu item. If so, a new instance of window will be created each time this code is called. However, from the code in first post, I see that when 'action' is executed, the window object is not destroyed, it just be hidden. This could be the problem! The number of window instances will increase each time user clicks on menu item. If "SomeForm" is inside window, then there will be many "SomeForm" to refer to.
-
9 Aug 2012 2:40 AM #5
you are right.
changed window.hide() to window.close() and now it works as expected.
Thanks a lot.


Reply With Quote