PDA

View Full Version : reset form from toolbar not work



valititi
8 Jan 2011, 9:12 PM
I have a form which load ok in a tabPanel:



var edFrm=new Ext.form.FormPanel({id:'formEdit',method:'POST', reader:myJsonReader,
items:[{xtype:'numberfield', id:'pays_iden' }, {xtype:'textfield', id:'pays_nume'}]
}).getForm().load({url:'mygetter.php?id=3&a=e', method:'POST'} );

var tbEdit=new Ext.Toolbar({stateId:'tbEdit'}); // then I have a toolbar
tbEdit.add(iconsCls:'mybtn',handler:function(){Ext.getCmp('formEdit').getForm().reset()});
// edFrm.getForm()... not also work

var tabs=new Ext.TabPanel({id:'mytabs', resizeTabs:true, defaults: {autoScroll:true} });
tabs.add({id:'tabEdit', title: 'Mode Edit', tbar:tbEdit, items:edFrm });
and then put it all this in a Ext.Window... My problems is that when I click the reset "button" it clears completely the form instead a correct reset. So, how to correctly reset the form in the tab by clicking on the toolbar ? But other than making a fake reset and loading the form again from the server ?

firefoxSafari
8 Jan 2011, 11:12 PM
I think this is what the trackResetOnLoad config option on the form is for. Setting it to true should work for you.

valititi
8 Jan 2011, 11:28 PM
finally... yessssssssssss :-)
thanks a lot, man.