PDA

View Full Version : Unset Textfield value after data load in Form Panel



leduc
23 Nov 2011, 5:40 AM
Dear All,

The problem seems to be simple, but I can't find any valid solution:
I have a FormPanel, used for create or update document.
When it's an update, the FormPanel is build with an URL and get the JSON with all needed informations.
All it's ok !, perfect ?
In fact no, in plus, I want to reset value for some fields of my FormPanel. (Update Date, Evolution...).
I can NOT modify the json answer with only interested fields.

If I try to add a FormPanel listerner on afterrender, the value of field is set to 'Null', ok, but directly replace by value from json file...
I try a textField listener on the afterrenderer, same effect...

So, my questions:
What is the event (if exist) that correspond to an after load json data on a FormPanel? (Warning, no specific store for my panel, only the url).
or
What is the property of textfield to not get the corresponding data when load a json store (always for FormPanel) ?

Thanks for your help.

darthwes
23 Nov 2011, 6:28 AM
Something like



myForm.load({
scope: myForm,
success: function (form, action) {
this.items.get(2).setValue('');
this.items.get(3).reset();
}
});



Enjoy :D

leduc
23 Nov 2011, 6:56 AM
...
I'm a little bit confused !!! ;-)
I'm looked for a long time to have FormPanel well loaded with data from url...
--> Only because I forget to add the form.load() action.

And today, I have lost many time because I forget... That there is a form.load() action !!!

Many thanks, all it's ok now !!!