-
13 Mar 2012 10:31 AM #1
[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
- Chrome 17
- Strict
- 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.
- Run the code.
- Click the "Close" button.
- When the Close button is clicked, the "default panel" should be set as the active item and now visible.
- The "default panel" is not displayed.
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
- WinXP Pro
-
13 Mar 2012 12:01 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
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.
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote