1. #1
    Sencha User
    Join Date
    Nov 2010
    Location
    France
    Posts
    37
    Vote Rating
    2
    EBS is on a distinguished road

      0  

    Question [4.0.0 - Solved] How to change the title of a region ?

    [4.0.0 - Solved] How to change the title of a region ?


    Hi,

    How to get or change dynamically the title of a region in border layout ?

    This code is wrong
    Code:
    var westZone = Ext.get('idWestRegion');
    var oldTitle = westZone.getTitle()
    ....
    westZone.setTitle(newTitle)
    and I didn't see in API doc how to do.

    Thanks
    EBS

  2. #2
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    It sounds like what you're trying to do is to change the title of a Panel that's inside one of your regions. If that's correct, then you can do one of two things:

    1) put an id on the Panel config, use Ext.getCmp(the id), or
    2) put an itemId on the Panel config and use ComponentQuery to locate it from a parent panel or viewport (yourviewportorparentpanel.query("#theitemid"))

    Either of those will produce a Panel reference, if successful. From there, you can call setTitle.

    Ext.get() returns an Element, not a Component, and so will have no setTitle() available.

    stevil

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Location
    France
    Posts
    37
    Vote Rating
    2
    EBS is on a distinguished road

      0  

    Default


    Thank you for your answer, but I don't want to change the title of the panel in the region but the title of the region.


    In this example, I would like to get dynamically the title of the west region "West Region" and change it to "My region title"

    Code:
    Ext.create('Ext.panel.Panel', {
            width: 500,
            height: 400,
            title: 'Border Layout',
            layout: 'border',
            items: [{
                title: 'West Region',
                region: 'west',
                id: 'westId',
                xtype: 'panel',
                height: 100,
                split: true
            },{
                title: 'Center Region',
                region: 'center',    
                xtype: 'panel',
                layout: 'fit'
            }],
            renderTo: Ext.getBody()
        });
    EBS
    PS: sorry for my poor english

  4. #4
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,663
    Vote Rating
    6
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    if you use
    Code:
    id: 'viewport'
    you can get the reference of the viewport.

    This way you can change title of center region:

    Code:
    Ext.getCmp('viewport').getLayout().regions.center.setTitle('Hello');
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  5. #5
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    You can do that if the component at that location is a Panel or one of its descendants, right? If it's a Container you're out of luck - you then have to go .down() to the child of the Container.

    That may sound like nit-picking, but if you load your panel content into border layouts via Ajax, a Container is often what you'll find there (because you can't add/remove a region once created).

    stevil

  6. #6
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,663
    Vote Rating
    6
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    I only wanted to show how to reference a region, you should know which elements are in and where to change what
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  7. #7
    Sencha User
    Join Date
    Nov 2010
    Location
    France
    Posts
    37
    Vote Rating
    2
    EBS is on a distinguished road

      0  

    Default


    Thank you Steffenk.

    It's ok; I can use setTitle....but getTitle doesn't exist (bug ?)...I must use
    Ext.getCmp('viewport').getLayout().regions.west.title
    EBS

  8. #8
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,663
    Vote Rating
    6
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    it's not consequent with getters/setters So often you have to use the properties directly.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

Similar Threads

  1. How to change the title of region:'center'?
    By edwardking in forum Ext 3.x: Help & Discussion
    Replies: 18
    Last Post: 1 Sep 2010, 9:38 PM
  2. Dynamically change region title
    By DomZ in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 26 Apr 2008, 5:31 AM
  3. Replies: 1
    Last Post: 1 Nov 2007, 12:29 AM
  4. how to update title of region?
    By x5150 in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 16 May 2007, 10:30 AM
  5. Change region title of Complex Layout
    By laercio_mac in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 13 Mar 2007, 2:26 PM

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."