1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    25
    Answers
    1
    Vote Rating
    0
    grnadav is on a distinguished road

      0  

    Default Unanswered: Applying flex after component creation

    Unanswered: Applying flex after component creation


    Hello

    When I try to apply flex to a component that's already been initialized, it does not affect (looking through the source I see that it doesn't have any listeners on it and the flex is only applied during creation.

    A side affect of that is that I wrap the component with a dummy container and give that container flex (because I control it's creation time)

    Is it a bug or a feature?

    Thanks!

  2. #2
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Answers
    93
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    There is no way to do this at the component/item level. You need to access the containers layout and set it using that. You can do this using the following code:

    Code:
    container.getLayout().setItemFlex(item, 3);
    Where container is your container, item is the item you want to change the flex on, and 3 is the new flex you want to set.

    There are no docs for this in PR4 unfortunately, but there will be in the next release.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  3. #3
    Sencha Premium Member
    Join Date
    Aug 2011
    Posts
    168
    Answers
    1
    Vote Rating
    2
    GertBoers is on a distinguished road

      0  

    Default


    When I try this:

    PHP Code:
    Ext.define('Delen0001.view.Dashboard', {
        
    extend'Ext.Container',
        
    xtype'dashboard',     
        
    config:{
            
    fullscreentrue,  
            
    layout: {
                
    type'vbox',
                
    pack'center'
            
    },
            
    id'testje',
            
    items:[
                {
                
    xtype'panel',
                
    id'blockone',
                
    items:[
                        {
                        
    xtype'toolbar',
                        
    title"Delen Today",        
                        },
                    ],
                
    flex1,
                
    listeners: {
                
                    
    tap: function() {
                    
                        
    Delen0001.view.Dashboard.getLayout().setItemFlex('blockone',0);
                    },
                    
    element'element'
    ... 

    I get this error:

    Uncaught TypeError: Object function () { return this.constructor.apply(this, arguments); } has no method 'getLayout'


    Can anyone perhaps provide the correct syntax for this line:
    PHP Code:
    Delen0001.view.Dashboard.getLayout().setItemFlex('blockone',0); 
    Thanks

Thread Participants: 2

Tags for this Thread

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..."