I have a question about multiple inheritance in ExtJS. Although I know that I can simply duplicate the code for this to happen, but I want to know if there is a way to code it more efficiently.
I have a custom component GridPanelin my structure called Kore.ux.grid.GridPanel. It extends Ext.GridPanelwith additional common functions and provides an interface for REST actions.
Soon after, my colleague wanted to EditorGridPanelbe implemented in the same way, that is, she wants him to be editable and at the same time to be able to easily perform REST actions.
My question is: is there a way to expand Ext.EditorGridPanelto use the customized features Kore.ux.grid.GridPanel?
Sorry for any grammatical errors, and I can rephrase it if it is confusing. Thank!!
EDIT
I searched googled again, and I found topics saying this is impossible. Is there any better coding pattern that I should follow if I have this problem?
Thank!
CHANGE AGAIN
So sorry I found a structure that suits me. Here is a method that came in handy:
var Common = function(){}
Ext.apply(Common.prototype, {
a : function(){},
b: function(){}...
});
Ext.ux.SomePanelA = Ext.extend ( Ext.Panel, {
stuff : ............
});
Ext.ux.SomePanelB = Ext.extend ( Ext.Panel, {
diffStuff : ............
});
Ext.applyIf(Ext.ux.SomePanelA.prototype, Common.prototype);
Ext.apply(Ext.ux.SomePanelB.prototype, Common.prototype);
Code source: http://www.sencha.com/forum/showthread.php?48000-multiple-inheritance&p=228271&viewfull=1#post228271
Please suggest useful suggestions again if you think you have the best solution :) Thank you!