PDA

View Full Version : [FIXED][3.x] isVisible problems



mjlecomte
16 Apr 2009, 10:16 AM
Originally questioned here:
http://extjs.com/forum/showthread.php?p=316988#post316988


I encounter similar problems with Ext 3.x on FF 3.0.8. Seems like the isStyle(DISPLAY) check might not be working properly.

If you use hideMode:'visibility' then the check seems to work ok.

This was my test code:


Ext.onReady(function(){

t = new Ext.Toolbar({
renderTo: document.body,
items: [
{
text: 'Button 1',
id: 'b1'
},
{
text: 'Button 2',
id: 'b2',
hidden: true
},
{
text: 'Button 3'
},
{
text: 'Button 4',
id: 'b4',
hideMode: 'visibility',
hidden: true
}
]
});


/**
* @cfg {String} hideMode
* <p>How this component should be hidden. Supported values are "visibility" (css visibility), "offsets" (negative
* offset position) and "display" (css display) - defaults to "display".</p>
* <p>For Containers which may be hidden and shown as part of a {@link Ext.layout.CardLayout card layout} Container such as a
* {@link Ext.TabPanel TabPanel}, it is recommended that hideMode is configured as "offsets". This ensures
* that hidden Components still have height and width so that layout managers can perform measurements when
* calculating layouts.</p>
*/
//hideMode: 'display',

//var vis = !this.isStyle(VISIBILITY,HIDDEN) && !this.isStyle(DISPLAY,NONE),

console.info('b1:',Ext.getCmp('b1').isVisible()); // returns true (expected)
console.info('b2:',Ext.getCmp('b2').isVisible()); // returns true (not expected)
console.info('b4:',Ext.getCmp('b4').isVisible()); // returns false (expected)

/*
.x-hidden, .x-hide-offsets {
position:absolute !important;
left:-10000px;
top:-10000px;
visibility:hidden;
}

.x-hide-display {
display:none !important;
}

.x-hide-visibility {
visibility:hidden !important;
}
*/

});

evant
11 May 2009, 7:35 PM
This is fixed in SVN.