-
28 Oct 2010 7:24 AM #11
When are you calling this line?
this.details.getActiveTab().resetData();
-
28 Oct 2010 7:39 AM #12
mm little bit more complicated:...

Inside the first panel i have a button:
After loading data I press the button and it clear all the fields...PHP Code:this.controlBar.getComponent('undoButton').addListener(
"click", function(a,b) {
console.log('reset data');
this.details.getActiveTab().resetData();
},
this
);
bye tnx
-
29 Oct 2010 4:36 PM #13
-
30 Oct 2010 5:16 AM #14
Ok... and you said that this works?
Code:store.on('load', function(){refToBasicForm.reset();});
-
30 Oct 2010 6:41 AM #15
mm not really
I've tryed only this way:
"This works" I mean that the form remains filled,PHP Code:getData: function(anag_id){
this.getForm().waitMsgTarget = this.getEl();
this.load({
url: 'http://localhost/get.php',
params: {'anag_id': anag_id},
waitMsg : 'Loading Data...'
});
this.getForm().reset(); /////////////////////////////////////////////////// this works
},
so I think that the reset() is working as it should ...
no?
-
31 Oct 2010 8:38 PM #16
Whoa. You can't reset the form after the call to load, load is asynchronous and non blocking. You should use the success or callback method inside load to reset the form. Your code is resetting the form but we don't know if the load has succeeded yet.
Wes
-
1 Nov 2010 5:03 AM #17
Ok, I think I found out why it's not working properly. Like the doc says:
Note: If subclassing FormPanel, any configuration options for the BasicForm must be applied to the initialConfig property of the FormPanel. Applying BasicForm configuration settings to this will not affect the BasicForm's configuration.
Since you might have more than one property to apply, I suggest you override the constructor as well.
E.g.
Code:MyForm = Ext.extend(Ext.FormPanel, { constructor: function(config) { config = config || {}; //Apply default config Ext.applyIf(config, { trackResetOnLoad: true }); //At constructor level, config options will get automatically added to //the initialConfig property. MyForm.superclass.constructor.call(this, config); }, initComponent: function() { ..... } });
-
1 Nov 2010 8:10 AM #18
Great!
It has worked correctly!
I didn't think to check if the configuration had been applied correctly.
thank u
-
1 Nov 2010 8:25 AM #19Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
Why so much code?
Code:Ext.form.BasicForm.prototype.trackResetOnLoad = true;
-
1 Nov 2010 11:29 AM #20
Well, that would set true as default for all forms, if that's what you want, then Condor solution would be better.
Similar Threads
-
Ext.BasicForm.reset dumps original values for hidden fields
By wwarby in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 24 Nov 2009, 12:21 PM -
[SOLVED] Radio not reset to their default values
By senacle in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 2 Jul 2009, 12:18 AM -
[2.2][CLOSED] BasicForm.updateRecord updates clears values
By igo in forum Ext 2.x: BugsReplies: 2Last Post: 3 Oct 2008, 5:48 AM -
BasicForm.reset() does not clear fields?
By dante in forum Ext 2.x: Help & DiscussionReplies: 6Last Post: 30 May 2008, 4:14 AM -
Form fields reset to default on submitting
By LorenzoW in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 30 Apr 2007, 6:42 AM


Reply With Quote