View Full Version : Referencing components in containers

13 Nov 2009, 7:41 AM

Im getting started with ExtJs so foregive me if this is dummy question.
Im trying to integrate ExtJs with component-oriented server side framework and I have problems with containers (and layouts).

I will explain it by example.

I have server side component which generates html and Js:

<div id="tabs1"></div>

Ext.onReady(function(){ new Ext.Panel({renderTo: 'tabs1', items: {title: 'simpleTab', html : 'A simple Tab'}});
This works fine, tabbed panel is rendered into my div element.

Now I would like to add this component into some parent (ie. viewport) but I would like to do this in separete JsStatement (each of my server side component generates his own <script> tag). So my viewport component renders:

Ext.onReady(function(){ new Ext.Viewport({layout: 'border', items: [{region: 'north', contentEl: 'tabs1'}, {region: 'center', html: 'center!'}]})
The problem (as I suspect) is in: contentEl: 'tabs1'. What I would like to achive is to add created before component to the viewport to north region but I dont want to configure tabbed component in ViewPort statement.

Its hard for me to decribe problem especially that Its my first day with ExtJs, but I hope someone will understand me and provide some help if not I'll try to describe it in more details.

One thing more,I dont have control for order of java scrips statements so in practice viewport statement can be generated before tabbed panel statement.

Kindly regards