0

i create these containers :

var cont0 = Ext.create ...
var cont1 = Ext.create ...
var cont2 = Ext.create ...

i used them here:

var cont3 = Ext.create ..., {

     items: [cont0, cont1]
}

var cont4 = Ext.create ... , {
    items : [cont1, cont2]
}

problem : item cont1 in cont3 is lost, but cont1 in cont4 is okay. Does this mean cont1's reference in cont3 was transferred to cont4 ? do i need to clone cont1 ?

how to reuse existing containers and apply them as items in other containers?

tonyo
  • 678
  • 1
  • 7
  • 22

1 Answers1

0

Why aren't you defining cont0, cont1 and cont2 and extending these? Then you could use the xtype name i.e. alias: 'widget.whatever' for your items.

Odds are based on the way this sounds, you probably have an "id" config for cont1 which means it can only be used once. Having the same id while tring to reuse a component will cause ExtJS to only render the component in the last place it finds it thus rendering cont1 to cont4.

radtad
  • 189
  • 5