Search code examples
javascriptextjssubmitformpanel

ExtJs 4 - Form panel submit without params


I'm using ExtJs 4.2.

I have a form panel contains some text fields.

For example:

 items: [{
                fieldLabel: 'User Name',
                afterLabelTextTpl: required,
                name: 'userName',
                allowBlank: false,
                tooltip: 'Enter admin user name'
               },{
                fieldLabel: 'Password',
                inputType:'password',
                afterLabelTextTpl: required,
                name: 'password',
                allowBlank: false,
                tooltip: 'Enter admin user paswword'
               }
        ],

I'm submiting the form by using:

this.up('form').getForm().submit({
                    method: 'POST',
                    url: 'someUrl',
                    params: <SomeOtherParams>,
                    success: function(form, action) {
                       Ext.Msg.alert('Success', action.result.msg);
                    },
                    failure: function(form, action) {
                        Ext.Msg.alert('Failure', action.result.msg);
                    }
});

I need to submit only the form additional params "SomeOtherParams" without the form basic params.

In my case the basic params are: "userName" and "password".

Can I somehow make this params to disappear?

I tried to configure "baseParams: null", but it doesn't seem to make any change.

Can anyone help?

Thanks.


Solution

  • you can simply set the submitValue property of your 2 unwanted fields to false