Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Phoenix, AZ
    Posts
    625
    Vote Rating
    10
    zombeerose will become famous soon enough zombeerose will become famous soon enough

      0  

    Default [4.1B3] Card layout does not activate item when removed

    [4.1B3] Card layout does not activate item when removed


    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.1 beta 3
    Browser versions tested against:
    • Chrome 17
    DOCTYPE tested against:
    • Strict
    Description:
    • Setting the active item of a card panel when a child component is removed does not work as expected.
    • Note: the 'remove' event is buffered intentionally. In real use, the container panel has multiple children that are destroyed at once when a user's authentication changes. The 'remove' handler would assign the last child item as the activeItem if available. However, this ultimately causes a conflict between the components being destroy vs displayed.
    Steps to reproduce the problem:
    • Run the code.
    • Click the "Close" button.
    The result that was expected:
    • When the Close button is clicked, the "default panel" should be set as the active item and now visible.
    The result that occurs instead:
    • The "default panel" is not displayed.
    Test Case:
    Code:
    Ext.create('Ext.panel.Panel',{
        activeItem: 0, //change to null to fix
        layout: {
            type: 'card'
        },
        items: [{
            html: 'Default Panel'
        },{
            html: 'Child 2',
            buttons: [{
                action: 'close',
                text: 'Close',
                handler: function(btn){
                    var panel = btn.up('panel');
                    panel.ownerCt.remove(panel);
                }
            }]
        }],
        listeners: {
            'afterrender': function(panel){
                panel.layout.setActiveItem(1);
            },
            'remove': {fn:function(panel,item){
                panel.layout.setActiveItem(0);
            },buffer:100}
        },
        title: 'Card Layout',
        frame: true,
        width: 100,
        height: 100,
        renderTo: Ext.getBody()
    });

    HELPFUL INFORMATION

    Additional CSS used:
    • only default ext-all.css
    Operating System:
    • WinXP Pro

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,656
    Vote Rating
    435
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Thanks for the report.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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