PDA

View Full Version : GridPanel inheritance & layout redefine



Pyja
24 Oct 2011, 5:28 AM
Hi,

My need : redefine a BorderLayout in the A object (that extends GridPanel)
Why : we created some objects (widely used) that extends GridPanel, and our code widely use/call some properties, methods of these B, A, GridPanel objects

let's see what's exist :

mypackage.A = Ext.extend(Ext.grid.GridPanel, {
... some properties
... some methods
});

mypackage.B = Ext.extend(mypackage.A {
... some other properties
... some other methods
});

var aBinstance = new B ({...});
we often call aBinstance.getStore(), aBinstance.items, ... and all that's available on GridPanel and A (that's why it's very hard to change inheritance)


Now, i would like to add an (optionally) toggle 'north' panel in my A object, and put the GridPanel in the 'center'.
But, because we widely use some properties, and methods, it's a hard work if we have to rewrite inheritance.

So, is it possible to redefine Layout of A, and put the extended GridPanel in 'center' (or simply the View) ?
Or rewrite template of A (and so define as BorderLayout) ? (don't know how to do that)
Or change the inheritance, but apply GridPanel properties/methods to the new A object ?

Thanks for help