1. #1
    Ext User
    Join Date
    Nov 2009
    Posts
    2
    Vote Rating
    0
    dlipski is on a distinguished road

      0  

    Default Referencing components in containers

    Referencing components in containers


    Hi,

    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:
    HTML Code:
    <div id="tabs1"></div>
    Code:
    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:

    Code:
    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
    Daniel
    Last edited by dlipski; 13 Nov 2009 at 7:46 AM. Reason: typo