PDA

View Full Version : FormPanel and Remote Validation



truijllo
4 Dec 2009, 7:35 AM
Hi guys
I'm trying to obtain validation error using a json service ( under django ) but I don't obtain communication with it or code errors.
I started with examples and demos customizing parts of code.

I've tried to use firebug but nothing happens and in my server log no calls are done do the script.

Any suggestions ?
( thank you ! )



var itemPanel = new Ext.form.FormPanel({
id: "itemType",
standardSubmit: true,
frame:true,
title: 'Item Type',
waitMsgTarget: true,
defaultType: 'textfield',
items: [ nameItem,
descriptionItem,
catList,
reorder
],
buttons: [{
text: 'Submit',
handler: function() {
itemPanel.form.submit({
waitMsg:'Saving Data...',
method: 'POST',
url: '/manageItems/',
success: function(f, a) {
f.setValues(a.result.data);
Ext.Msg.alert('Success','Quote #'+a.result.id+' added');
f.getForm().reset();
},
failure: function(f, a) {
var result = a.result;
console.log(a);
f.markInvalid(a.result.errors);
}
})
}
defaults: { msgTarget : 'side' }
});