REQUIRED INFORMATION
Ext version tested:
Browser versions tested against:
- Ext 4.1.0
- Ext 4.1.1
- IE9
- FF10.0.5 ESR (firebug 1.9.2 installed)
- Google Chrome 20.0.1132.57 m
Description:
Steps to reproduce the problem:
- Setting "animCollapse" "false" as a class property is overrided after initialization as true.
The result that was expected:
- Create a class with "animCollapse : false"
- Create two panel configs, one of them set to xtype equal to alias of your not animated panel class and "collapsible:true"
- Create window with 'border' layout setting items array of two panel configs created on previous step and with button alerting property "animCollapse" of your not animated panel
- Notice that inside InitComponent "this.animCollapse" is recognized as "false"
- After page loaded click on button alerting property "animCollapse" of your not animated panel and observe that "this.animCollapse" is recognized as "true"
The result that occurs instead:
- "this.animCollapse" should preserve the same during lifetime of panel if not specified anything else
Test Case:
- "this.animCollapse" loses initial value
Code:Ext.onReady(function() { Ext.define('NotAnimatedPanel', { alias : 'widget.notanimated', extend : 'Ext.form.Panel', animCollapse : false, initComponent : function () { this.callParent(); console.log('animCollapse = ' + this.animCollapse + '\n I am happy unanimated panel:)'); } }); var panel1 = {//layout: 'absolute', defaultType: 'textfield', border: false, region : 'center', items: [{ fieldLabel: 'Send To', fieldWidth: 60, msgTarget: 'side', allowBlank: false, x: 5, y: 5, name: 'to', anchor: '-5' // anchor width by percentage }, { fieldLabel: 'Subject', fieldWidth: 60, x: 5, y: 35, name: 'subject', anchor: '-5' // anchor width by percentage }, { x:5, y: 65, xtype: 'textarea', style: 'margin:0', hideLabel: true, name: 'msg', anchor: '-5 -5' // anchor width and height }]}; var panel2 = { xtype: 'notanimated', //layout: 'absolute', region : 'west', border: false, collapsible : true, split : true, collapsed: true, items: [{ fieldLabel: 'Send To', fieldWidth: 60, msgTarget: 'side', allowBlank: false, x: 205, y: 5, name: 'to1', anchor: '-5' // anchor width by percentage }, { fieldLabel: 'Subject', fieldWidth: 60, x: 205, y: 35, name: 'subject1', anchor: '-5' // anchor width by percentage }, { x:205, y: 65, xtype: 'textarea', style: 'margin:0', hideLabel: true, name: 'msg1', anchor: '-5 -5' // anchor width and height }] }; var win = Ext.create('Ext.window.Window', { title: 'Resize Me', width: 300, height: 300, minWidth: 300, minHeight: 200, /* layout : { type : 'vbox', align : 'stretch' },*/ layout: 'border', plain:true, items: [panel1, panel2], buttons: [{ text: 'Click me!!!', handler : function () { console.log('animCollapse = ' + na.animCollapse + '\n And now I am animated :( I feel upset :('); } },{ text: 'Cancel' }] }); na = win.child('[xtype="notanimated"]'); win.show(); });?
HELPFUL INFORMATION
If animCollapse property is set as class default property it is not recognized by function "hasOwnProperty" as being "OwnProperty", so in this codepiece
animCollapse is set to false but control goes to assigning it true (inside second "if" clause)
Code:if (!item.hasOwnProperty('collapseMode')) { item.collapseMode = me.panelCollapseMode; } if (!item.hasOwnProperty('animCollapse')) { if (item.collapseMode != 'placeholder') { item.animCollapse = false; } else { item.animCollapse = me.panelCollapseAnimate; } }
See this URL for live test case:
http://jsfiddle.net/Patlatus/xwRnX/18/
Debugging already done:
Possible fix:
- none
Additional CSS used:
- not provided
Operating System:
- only default ext-all.css
- Win7