Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    63
    Vote Rating
    1
    stevanicus is on a distinguished road

      0  

    Default Mixin parameters have no effect

    Mixin parameters have no effect


    Ext version tested:
    • Ext 4.1.1-rc2
    Browser versions tested against:
    • FF19
    Description:
    • Some parameters defined in a Mixin have no effect on the panel where the mixin is added
    Test Case:

    Code:
     
    
    Ext.define("App.mixins.PanelDefaults", {
        
        layout:{
            type:'vbox',
            align:'stretch'
        },
        
        bodyStyle:{
            padding:"5px"
        },
        
        style:{
            marginBottom:"5px"
        },
        
    //has no effect
        titleCollapse:true,
        collapsible:true,
        collapseDirection:'top'
    
    });
    
    Ext.define("App.view.Panel", {
        extend:'Ext.panel.Panel',
        mixins:['App.mixins.PanelDefaults']
    
    });
    The styles from the mixin are effective on the panel - however the following doesnt do anything and the panel is not collapsible

    Code:
        titleCollapse:true,
        collapsible:true,
        collapseDirection:'top'
    Workaround:

    Code:
     
    
    Ext.define("App.mixins.PanelDefaults", {
        
        layout:{
            type:'vbox',
            align:'stretch'
        },
        
        bodyStyle:{
            padding:"5px"
        },
        
        style:{
            marginBottom:"5px"
        },
        
        initMe:function(){
             this.titleCollapse =  this.titleCollapse || true;
             this.collapsible = this.collapsible || true;
             this.collapseDirection = this.collapseDirection || 'top';
        }
    });
    
    Ext.define("App.view.Panel", {
        extend:'Ext.panel.Panel',
        mixins:['App.mixins.PanelDefaults']
        initComponent:function(){
             this.initMe();
             this.callParent();
        }
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    This looks to be fixed in 4.2.0 releases.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1