1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    8
    Vote Rating
    0
    kisundar is on a distinguished road

      0  

    Default Unanswered: How do I access the outer class defintion instance

    Unanswered: How do I access the outer class defintion instance


    Code:
    Ext.define('BuildStatus.view.Login',{
        extend: 'Ext.form.Panel',
        title: 'Login Page',
        url: 'login.jsp',
        defaultType: 'textfield',
        bodyStyle:'padding:5px 5px 0',
        buttonAlign: 'left',
        items: [
            {
                fieldLabel: 'Name',
                name: 'name',
                allowBlank:false
            },
            {
                fieldLabel: 'Password',
                name: 'password',
                allowBlank:false
            }
        ],
        frame:true,
        buttons: [{
            text: 'Login',
            formBind: true,
            //Function that fires when the user clicks the button
            handler: function()
            {
                console.log("button clicked");
                getForm().submit(
                {
                   method: 'POST',
                   waitTitle: 'Connecting',
                   waitMsg: 'Sending data...',
    
                   success: function()
                   {
                      console.log("Login successful.");
                   },
                   failure: function(form, action)
                   {
                      console.log("Login failed.");
                      getForm().reset();
                   }
                });
    
            }
        }]
    })
    Now the question I have is when i run this, i get an error saying that getForm() is undefined. How do I access the form instance when the button is clicked. Kindly advice.

  2. #2
    Touch Premium Member
    Join Date
    Feb 2011
    Location
    NJ
    Posts
    310
    Answers
    59
    Vote Rating
    50
    droessner is a jewel in the rough droessner is a jewel in the rough droessner is a jewel in the rough

      0  

    Default


    Inside the button handler you can use this.up('form') to get the form instance.

Thread Participants: 1

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