PDA

View Full Version : How can one class inherit 2 classes in ExtJs?



tmhaohong
5 Mar 2011, 10:06 AM
Hi there,

Can someone let me know how can one class inherit 2 classes in ExtJs?

Thanks and best regars,:D

todic
14 Mar 2011, 6:56 AM
Hi,

Directly - you can't do that. Even if ExtJS allows you to do that, you shouldn't because that's isn't best OO practice( and most modern languages won't let you do that). So, if you really need something like that, then you probably have some problem with your code organization.


You can, on the other hand do something like this:





myClassA = Ext.extend( Ext.Component, {..});


myClassB = Ext.extend( myClassA, {…});


myClassC = Ext.extend( myClassB, {…});


And so you'll have myClassC extends both myClassA and myClassB.