开发者

Extjs getting fields values from extended FormPanel

The submit button for my formPanel works by using scope:this as it is an extended formPanela nd ext.getCmp(formid) doesn't work.

In my submit function, it successfully works using this.getForm().submit(....). However when trying to get the field values, this.getForm().getFields() doesn't work, flagging that it is not a function.

the buttons & handler function is nested within the开发者_JAVA技巧 formPanel setup.

Can anyone shed light on how to get the values in this manner?

Submit function:

{
    text: 'Submit',
    id: "submitBtn",                    
    handler: this.submit,
    scope: this                    
}
....

,submit : function(url, waitMsg) {
    //this.getForm.getFields()
    this.getForm().submit({
        url: url
        ,scope: this
        ,waitMsg: 'Please wait'
        ,success: this.onSuccess
        //,failure: this.onFailure

    });
}



submit : function(url, waitMsg) {
        //this.getForm.getFields() -- should work now
        this.getForm().submit({
            url: url
            ,scope: this
            ,waitMsg: 'Please wait'
            ,success: this.onSuccess
            //,failure: this.onFailure
        });
    }.createDelegate(this)


I've resolved this by not using the submit action but by using a simple Ext.Ajax.request:

,submit : function() {
        var data = this.getForm().getValues();
        Ext.Ajax.request({
            url: '...',
            method: 'GET',
            timeout:180000,
            params: {
                param1: Ext.encode(this.getForm().getValues())
            }
            .
        })
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜