View Full Version : How to break apart Components into separate files

16 Feb 2011, 10:28 AM
I am a newbie to js and extjs so please bear with me.

I am trying to break apart some of my more complex panels into their own classes and write them in their own js file.

I am not really overriding anything in Ext.Panel so I am not sure that I should 'extend' it.

Should I extend such that I can new that pre configured panel in another place/file.

...items[ new MyPanel() ] ....

or should I just create a new Ext.Panel object in MyPanel.js and reference that in another place/file
myPanel = new Ext.Panel({....

then in another file

... items [ myPanel ] ...