sencha-touch-2sencha-touch-2.1

disable device GO button if form panel nested under other form panel


I have one formpanel which is present inside other form panel, and inner form panel having text field. when user tap on the device go button after entering some value into textfield, its trying to submit. but i don't want to submit the form on go button tap. here is my code :

Ext.define('Test.view.FormPage', {
extend: 'Ext.form.Panel',
xtype: 'formPage',
config: {
    standardSubmit: false,
    submitOnAction: false,
    items: [{
            xtype: 'formpanel',
            standardSubmit: false,
            submitOnAction: false,
            height: 300,
            items: [{
                    xtype: 'textfield',
                    label: 'name',
                    name: 'name',
                    value: '',
                    placeholder: 'name'
                } ]
          } ]
  }});

i am using sencha 2.3.1.Please provide some idea how to fix this issue.


Solution

  • True you are getting this result, as there are two imput type submit buttons.

    If you do not need the submit buttons you could create your own formpanel with

    getElementConfig: function() {
        var config = this.callParent();
        // add this line if you extend from formpanel
        config.children.pop();
        //<---------
        return config;
    }
    

    Then it won't bother you. But there will be no more input with type submit!