PDA

View Full Version : Extend Ext.Window leads to too much recursion



RooSoft
25 Feb 2010, 12:03 PM
Hello!


I have extended the Ext.Window class like this:



Ext.namespace('RooSoft.forms');

RooSoft.forms.ChooseActivityWindow = function(config) {
RooSoft.forms.ChooseActivityWindow.superclass.constructor.call(this, config);
};

Ext.extend(RooSoft.forms.ChooseActivityWindow, Ext.Window, {
title: 'Choose an activity to display on the map',
layout: 'fit',
width: 500,
height: 300,
closeAction: 'hide',
plain: true,

/* items: new Ext.TabPanel({
autotabs: true,
activetab: 0,
deferredrender: false,
paramsAsHash: false,
border: false
}), */

buttons: [{
text: 'Submit',
disabled: true
}, {
text: 'Close',
handler: function() {
win.hide();
}
}]
});


It works well until I uncomment the TabPanel. In that case, Firebug reports too much recursion. The end result is that the window doesn't show up.

That's weird because when written inline in a script, the same exact code works perfectly including the TabPanel.

Any idea about what's wrong?


Thanks!

Marc Lacoursiere
RooSoft Computing inc.

rbastic
25 Feb 2010, 12:18 PM
Looks like deferredRender has the wrong case etc

autotabs also might be autoTabs, unsure, didn't check

double-check all your parameters

RooSoft
25 Feb 2010, 12:23 PM
Good guess... I have tried without luck.

Look at the following code... It still crashes with a too much recursion message.



Ext.namespace('RooSoft.forms');

RooSoft.forms.ChooseActivityWindow = function(config) {
RooSoft.forms.ChooseActivityWindow.superclass.constructor.call(this, config);
};

Ext.extend(RooSoft.forms.ChooseActivityWindow, Ext.Window, {
title: 'Choose an activity to display on the map',
layout: 'fit',
width: 500,
height: 300,
closeAction: 'hide',
plain: true,

items: new Ext.TabPanel({
/* autoTabs: true,
activeTab: 0,
deferredRender: false,
paramsAsHash: false,
border: false */
}),

buttons: [{
text: 'Submit',
disabled: true
}, {
text: 'Close',
handler: function() {
win.hide();
}
}]
});


Notice that the TabPanel is there with configuration commented out.

25 Feb 2010, 1:16 PM
follow the patterns provided by the library and other users. Do *not* set an instance of a class as a configuration.

RooSoft
26 Feb 2010, 6:13 AM
Thanks!

Where can I get information about good practices in that case? I'm not sure how to do that cleanly.

26 Feb 2010, 6:14 AM
Extjs.com/learn, my book, other senior community member's code?

RooSoft
26 Feb 2010, 6:29 AM
I bought your book...

Which chapter do you recommend me about this subject?

26 Feb 2010, 6:31 AM
Thank you :)

CH15 and 16, and 17 when it's done, which should be very soon

RooSoft
26 Feb 2010, 6:53 AM
Got it, I am now creating the instance of the panel in the constructor and it works.


Thank you very much Jesus!

26 Feb 2010, 6:57 AM
Glad i could help :).

I hope you find other stuff in teh book helpful as well.