form.load({params: foo:'bar'}) sends data as null
Hello,
I have a form where I need to load the data from a Direct call, form is configured with the api for load and submit.
When I call
Code:
form.load({
params: {
foo:'bar'
}
});
The data sent over the wire is:
Code:
{"action":"Profile","method":"getData","data":[null],"type":"rpc","tid":16}
if I call it direct like:
Code:
Profile.getData({
params: {
foo:'bar'
}
});
the data sent over the wire is:
Code:
{"action":"Profile","method":"getData","data":[{"params":{"foo":"bar"}}],"type":"rpc","tid":8}
I rather use the form load and form submit methods instead of calling directly the direct fn. Any ideas why the form.load method doesn't send any data?
Direct data param problem
Hi,
I'm having a similar problem here.
I'm trying to send a form, but data is been set as [undefined]
Have you solved the problem?
Tnks in advance.
I'm using architect to do this.
here the json data
{"action":"QueryDatabase","method":"frmHandler_cadastrarAnalista","data":[undefined],"type":"rpc","tid":3}
my form
<code>
xtype: 'form',
id: 'form_analista',
layout: {
type: 'auto'
},
bodyPadding: 10,
title: '',
api: {submit: QueryDatabase.frmHandler_cadastrarAnalista},
method: 'POST',
items: [
{
xtype: 'textfield',
margin: '5 0 5 0',
width: 453,
name: 'nome',
fieldLabel: 'Nome:'
},
{
xtype: 'textfield',
margin: '5 0 5 0',
name: 'usuario',
fieldLabel: 'Usuário:'
}
]
},
{
xtype: 'button',
handler: function(button, event) {
var form = Ext.getCmp("form_analista").getForm();
if (form.isValid()){
form.submit({
success: function(form, action){
Ext.Msg.alert("GO");
Ext.Msg.alert('Success', action.result.msg);
},
failure: function(form, action){
Ext.Msg.alert("DONT GO");
Ext.Msg.alert('Failure', action.result.msg);
}
});
}else{
Ext.Msg.alert('INVALID');
}
},
itemId: 'bt_salvar_analista',
text: 'Salvar'
}
]
</code>