1. #1
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,895
    Vote Rating
    176
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default [RC3] Flex -vs- width

    [RC3] Flex -vs- width


    I was thinking that if I set a flex property and a width property that the width property would override the flex in 4.0.x. Does that sound right? Maybe it's not.

    I did see, though, that in the documentation that in order to cancel flex you can use 0 or undefined. Seems in RC3 undefined isn't working to cancel flex, but 0 and null will.

    Code:
    Ext.widget('viewport', {
    	layout: {
    		type: 'hbox'
    		, align: 'stretch'
    	}
    	, defaults: { flex: 1 }
    	, items: [{
    		title: 'Panel 1'
    		, width: 100
    		, flex: undefined
                    //, flex: null
    	}, {
    		title: 'Panel 2'
    	}, {
    		title: 'Panel 3'
    	}]
    });

  2. #2
    Touch Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    547
    Vote Rating
    23
    svenna has a spectacular aura about svenna has a spectacular aura about

      0  

    Default


    Flex overrides.. It does this in 4.0 also. I'm using it as a feature, I guess this would be a breaking change and sencha may want to wait to 5.x before doing a change like this.
    Sven Tore Iversen

  3. #3
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,895
    Vote Rating
    176
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    Oh, ok. Couldn't remember which overrode which.

    The flex: undefined not cancelling in RC3 is different, though, right? Documentation still says use 0 or undefined so I wonder if that is a bug in RC3?

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,572
    Vote Rating
    309
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Initially 4.1 worked the other way round but it was switched to maintain compatibility. It should now behave the same as 4.0. I believes it's been this way for all the RCs.

    I don't think there's a bug here. The docs for flex appear to be correct about the use of an undefined value. However, in your example the flex is not undefined because it is overridden by the defaults. I don't believe anything has changed from 4.0 in that regard.

  5. #5
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,895
    Vote Rating
    176
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    I tried overriding the flex property with 0, null, and undefined in RC2 and each option resulted in the flex property overriding the config passed in by defaults. I did the same in RC3 and see that 0 and null override the defaults config, but undefined does not.

    As soon as I loaded up RC3 when it was released I my flex layouts with flex undefined were all failing so I checked out the docs to see if undefined was no longer valid as a way to dismiss it in the flex layout, but RC3 docs still say 0 and undefined are the way to go. I changed each failing instance with flex: null and it works to dismiss the container from the flex layout, but wondered if it was a bug since the docs still say undefined or 0.

  6. #6
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,572
    Vote Rating
    309
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I've just tried this myself. It seems the priority switch occurred between RC1 and RC2, not before the RCs as I claimed previously.

    Using either RC2 or RC3 I get the same behaviour as 4.0.7.

    Perhaps we're reading different sections in the docs but I don't see a mistake. I'm looking at the docs for the config option flex, which appear to be correct to me. Using undefined as a flex value will cause it not to be flexed, however in your example the flex value is not undefined due to the use of defaults. I don't believe the way defaults are applied has changed at any point.

  7. #7
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,895
    Vote Rating
    176
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    Ok. I was thinking that any configs on the items would override whatever was in the defaults config.
    "Defaults are applied to both config objects and instantiated components conditionallyso as not to override existing properties in the item (see Ext.applyIf)."

    If I use flex: null it does override the flex, but not if I used flex: undefined. Was just thinking that undefined would override it based on what I was reading here:
    "This configuration option is to be applied to child items of the container managed by this layout. Each childitem with a flex property will be flexed (horizontally in hbox, vertically in vbox) according to each item'srelative flex value compared to the sum of all items with a flex value specified. Any child items that haveeither a flex = 0 or flex = undefined will not be 'flexed' (the initial size will not be changed)."

    Though, I'm starting to suspect I'm must misreading the docs and shouldn't have been using flex: undefined in my app up to this point. Just brought it up because as I updated from RC2 to 3 it was something I had to go and update to fix my layout.

    Code:
    Ext.widget('viewport', {
    	layout: {
    		type: 'hbox'
    		, align: 'stretch'
    	}
    	, defaults: { flex: 1 }
    	, items: [{
    		title: 'Panel 1'
    		, width: 100
    		, flex: null
    	}, {
    		title: 'Panel 2'
    	}, {
    		title: 'Panel 3'
    	}]
    });

  8. #8
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,572
    Vote Rating
    309
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Quote Originally Posted by slemmon View Post
    Just brought it up because as I updated from RC2 to 3 it was something I had to go and update to fix my layout.
    That's the bit I don't get. I see exactly the same behaviour in both RC2 and RC3. Now RC1, that's a different story...

    Whether or not applyIf overrides undefined values is left a little vague in the docs but a quick look at the source suggests it hasn't changed in a while.

  9. #9
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,895
    Vote Rating
    176
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    For what it's worth I just re-tested to make sure I'm giving a more accurate report. Below is the test script and the results in IE8 from 4.0.7, 4.1 RC2, and 4.1 RC3. Looks like a change between 4.0.7 and RC2/3. Maybe 4.0.7 was the buggy version and 4.1 fixed it? The documentation still throws me a little if this is the intended behavior, but I can certainly live with it.

    Code:
    Ext.widget('viewport', {
        layout: {
            type: 'hbox'
            , align: 'stretch'
        }
        , defaults: { flex: 1 }
        , items: [{
            title: 'Panel 1'
            , width: 100
            , flex: undefined
        }, {
            title: 'Panel 2'
        }, {
            title: 'Panel 3'
        }]
    });
    4.0.7
    flex-4.0.7.PNG

    4.1 RC2
    flex-4.1rc2.PNG

    4.1 RC3
    flex-4.1rc3.PNG
    Last edited by slemmon; 16 Apr 2012 at 6:22 AM. Reason: ordered images

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..." hd porno faketaxi