1. #1
    Sencha Premium Member
    Join Date
    Mar 2011
    Posts
    3
    Vote Rating
    0
    jensho is on a distinguished road

      0  

    Default 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();

  2. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    109
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    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.

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2011
    Posts
    3
    Vote Rating
    0
    jensho is on a distinguished road

      0  

    Default


    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.

  4. #4
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    109
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    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.

  5. #5
    Sencha Premium Member
    Join Date
    Mar 2011
    Posts
    3
    Vote Rating
    0
    jensho is on a distinguished road

      0  

    Default


    you are right.
    changed window.hide() to window.close() and now it works as expected.

    Thanks a lot.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar