PDA

View Full Version : Inheritance question



waffle
27 Feb 2017, 3:33 PM
I have two forms that extend a base class. The UI differs slightly, but they do have one panel in common. Rather than repeating the code for that panel in both subclasses, what is the best way of defining it in the parent's initComponent?

silcreval
2 Mar 2017, 9:43 AM
You can use plugins to add behaviour to a class. Ext.AbstractPlugin derives from Ext.Component, and has an init where you can setup elements, etc. You can then use this plugin in both classes.

mixins - dont derive from Ext.Component, so you can use them for other non UI type behaviour.

waffle
6 Mar 2017, 8:58 PM
But I'm looking to add a panel in the parents initComponent() - does this apply?