Note that there are some explanatory texts on larger screens.

plurals
  1. POExtjs multiple inheritance?
    primarykey
    data
    text
    <p>I have a question regarding multiple inheritance in ExtJS. While I know I can simply duplicate the code to make it happens, but I want to know if there is any way to code it more efficiently.</p> <p>I have a customized <code>GridPanel</code> component in my framework, called <code>Kore.ux.grid.GridPanel</code>. It extends <code>Ext.GridPanel</code> with extra common functionalities and provides interface for REST actions.</p> <p>Soon later, my colleague wanted to have <code>EditorGridPanel</code> to be also implemented in the same manner, ie, she wants it to be editable, and at the same time, have the ability to do REST actions easily.</p> <p>My question is, is there any way I can extend <code>Ext.EditorGridPanel</code> to take up the customized <code>Kore.ux.grid.GridPanel</code> functionalities?</p> <p>Sorry for any grammar errors and I can rephrase it if it's confusing. Thanks!!</p> <p><strong>EDIT</strong></p> <p>I googled again, and I found threads saying it's impossible. Is there any better coding pattern I should follow if I have this problem?</p> <p>Thanks!</p> <p><strong>EDIT AGAIN</strong></p> <p>So sorry I found the structure that suits me.. Here is the method I found useful to me:</p> <pre><code>var Common = function(){} //abstract class 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></pre> <p>Code Source: <a href="http://www.sencha.com/forum/showthread.php?48000-multiple-inheritance&amp;p=228271&amp;viewfull=1#post228271" rel="nofollow">http://www.sencha.com/forum/showthread.php?48000-multiple-inheritance&amp;p=228271&amp;viewfull=1#post228271</a></p> <p>Please again provide useful suggestions if you think you have a better solution :) Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload