-
uncaught exception: [Exception... "Component returned failure code
uncaught exception: [Exception... "Component returned failure code
when formpanel add textfield which is removed
uncaught exception: [Exception... "Component returned failure code
var idField = Ext.create('Ext.form.Text',{fieldLabel: 'id', name:'id'});
var formPanel = Ext.create('Ext.form.FormPanel', {
renderTo: Ext.getBody(),
bodyPadding: 5,
width: 350,
url: '/user/add',
layout: 'anchor',
defaults: {
anchor: '100%'
},
defaultType: 'textfield',
items: [idField,
{
fieldLabel: 'First Name',
name: 'first',
allowBlank: false
},{
fieldLabel: 'Last Name',
name: 'last',
allowBlank: false
}],
buttons: [{
text: 'Reset',
handler: function() {
this.up('form').getForm().reset();
}
}, {
text: 'Submit',
formBind: true,
disabled: true,
handler: function() {
var form = formPanel.getForm();
formPanel.remove(idField, true);
if (form.isValid()) {
form.submit({
success: function(form, action) {
formPanel.add(idField);//exception
//Ext.Msg.alert('Success', action.result.msg);
},
failure: function(form, action) {
Ext.Msg.alert('Failed', action.result.msg);
}
});
}
}
}]
});
Similar Threads
-
By lebesnec in forum Ext.Direct
Replies: 1
Last Post: 1 Jun 2010, 11:46 PM
-
By dannyg in forum Ext 3.x: Help & Discussion
Replies: 2
Last Post: 7 Dec 2009, 8:29 PM
-
By diclofoss in forum Ext 3.x: Help & Discussion
Replies: 7
Last Post: 21 Nov 2009, 4:36 AM
-
By larest in forum Ext 2.x: Help & Discussion
Replies: 2
Last Post: 4 Apr 2009, 1:03 PM
-
By Gog in forum Ext 2.x: Help & Discussion
Replies: 6
Last Post: 2 Apr 2009, 10:18 AM
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us