PDA

View Full Version : Ext.getCmp("binaformu").submit(); doesn't work



darkhorni
11 Feb 2013, 11:59 PM
I have


{
url: 'php/post_data.php?way=building,
defaultType: 'textfield',
xtype: "form",
id: "binaformu",
items: [
{
xtype:'fieldset',
title: 'Building ?nformation',
defaultType: 'textfield',
items:[
{
fieldLabel: 'Building Name',
name: 'BuildingName',
allowBlank: false
},
{
fieldLabel: 'Bina Yetkilisi',
name: 'FullName',
allowBlank: false,
xtype: "combo",
displayField: 'FullName',
valueField: 'FullName',
store: store,
queryMode: 'local',
typeAhead: true
},
]
}]
},
buttons: [{
text: 'Save',
handler: function() {
Ext.getCmp("binaformu").submit({
success: function(form, action)
{
Ext.Msg.alert('Success', action.result.message);
},
failure: function(form, action)
{
Ext.Msg.alert('Failed', action.result ? action.result.message : 'No response');
}
});
Ext.getCmp("accordion-panel").load;
Ext.getCmp("binaEditWin").close();
}
},{
text: 'Cancel',
handler: function() {
Ext.getCmp("binaEditWin").close();
}
}]

However it does not submit the form. What I'm doing wrong here?

vadimv
12 Feb 2013, 12:18 AM
How doesn't work ? any error, have you checked in console->network if the request is made to the server ?
I see in your code a wrong line:
Ext.getCmp("accordion-panel").load;

darkhorni
12 Feb 2013, 12:20 AM
How doesn't work ? any error, have you checked in console->network if the request is made to the server ?
I see in your code a wrong line:
Ext.getCmp("accordion-panel").load;



No error in console. No post or get request to the target.


Ext.getCmp("accordion-panel").load; is a grid panel. In order to refresh the data.

Edit: I have overcome the problem by using Send form example on ExtJS's example. A bit different but it worked.

Arg0n
12 Feb 2013, 12:37 AM
You could try: Ext.getCmp("binaformu").getForm().submit()

vadimv
12 Feb 2013, 12:47 AM
You could try: Ext.getCmp("binaformu").getForm().submit()
is the same, form.Panel.submit is a proxy to form.Basic.submit

Arg0n
12 Feb 2013, 12:52 AM
hmpf... ^^

Does Ext.getCmp("binaformu") contains the form?


handler: function(button) {
button.up('form').submit({
success: function(form, action)
{
Ext.Msg.alert('Success', action.result.message);
},
failure: function(form, action)
{
Ext.Msg.alert('Failed', action.result ? action.result.message : 'No response');
}
});
Ext.getCmp("accordion-panel").load;
Ext.getCmp("binaEditWin").close();
}

Maybe? xD

scottmartin
13 Feb 2013, 11:19 AM
See if you are getting the component you are expecting:



var form = Ext.getCmp("binaformu");
console.log(form);


Scott