Сенсорная форма игнорирует отправленные значения - PullRequest
0 голосов
/ 19 октября 2011

Я отправляю форму, но волшебным образом значения моей формы не публикуются. onBeforeSubmit срабатывает с ожидаемыми значениями, и я могу даже сделать this.getValues() непосредственно перед this.submit ()

MyForm= function(config){
if ( typeof config !== 'object' ) { 
config.url='test.php';
// config.standardSubmit = true;
config.items= [{
    xtype: 'fieldset',
    title: 'Login Details',
    instructions: 'Please enter the information above.',
    defaults: {
        required: true,'
    },
    items: [{
        xtype: 'textfield',
        name : 'username'
    }, {
        xtype: 'passwordfield',
        name : 'password'
    }]
}];
var tbarBottom = {
    xtype: 'toolbar',
    dock: 'bottom',
    items: [{
        text: 'Login',
        ui: 'confirm',
        handler: function() {
            this.onLoginClick();
        },
        scope: this
    }]
};
config.listeners= {
    beforesubmit: function(formpanel, values, options) {
    console.log(values);//yup they are there

    },
    scope:this
}
config.dockedItems= [tbarBottom];

MyForm.superclass.constructor.call(this,config);
};


Ext.extend( MyForm, Ext.form.FormPanel,{

onResetClick: function() {
    this.reset()
},
onLoginClick: function() {
    console.log(this.getValues());//yup they are there
    this.submit()
}

});

TL; DR Это отправляется на сервер, но у меня нет опубликованных значений, у вас есть идеи, почему?

1 Ответ

0 голосов
/ 10 апреля 2012

В соответствии с http://docs.sencha.com/touch/1-1/#!/api/Ext.data.Request-cfg-method значение по умолчанию для method равно GET, его следует изменить на POST в config obj.(Например, config.method='POST') и вы идете

...