PDA

View Full Version : [OPEN-1293] isVisible and IE6



Thylia
28 Sep 2010, 7:55 AM
Hello,

When a field is hidden in a collapsed fieldset, and we check if it is visible or not the isVisible function in IE6 always answers true.

Works correctly under FF and IE8


Ext.onReady(function(){
var fsf = new Ext.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
frame:true,
title: 'Simple Form with FieldSets',
bodyStyle:'padding:5px 5px 0',
width: 350,

items: [{
xtype:'fieldset',
checkboxToggle:true,
title: 'User Information',
autoHeight:true,
defaults: {width: 210},
defaultType: 'textfield',
collapsed: true,
items :[{
fieldLabel: 'First Name',
name: 'first',
allowBlank:false
},{
fieldLabel: 'Last Name',
name: 'last'
},{
fieldLabel: 'Company',
name: 'company'
}, {
fieldLabel: 'Email',
name: 'email',
vtype:'email'
}
]
},{
xtype:'fieldset',
title: 'Phone Number',
collapsible: true,
autoHeight:true,
defaults: {width: 210},
defaultType: 'textfield',
items :[{
fieldLabel: 'Home',
name: 'home',
value: '(888) 555-1212'
},{
fieldLabel: 'Business',
name: 'business'
},{
fieldLabel: 'Mobile',
name: 'mobile'
},{
fieldLabel: 'Fax',
name: 'fax'
}
]
}],

buttons: [{
text: 'Save',
handler: function(){
if ( !fsf.getForm().isValid() ) {
var valid = true;
var fieldItems = fsf.getForm().items;
fieldItems.each(function(f) {
if ( !f.isValid() ) {
alert ( f.fieldLabel + ' : ' + f.id + ".isVisible()= " + f.isVisible() );
if ( !f.isVisible() ) {
alert ( "!f.isVisible()" );
if ( !f.hideParent ) {
alert ( "!f.hideParent" );
if ( !f.ownerCt.hidden && !f.ownerCt.collapsed ) {
alert ( "!f.ownerCt.hidden" );
if ( !f.ownerCt.ownerCt.hidden && !f.ownerCt.ownerCt.collapsed ) {
alert ( "!f.ownerCt.ownerCt.hidden" );
if ( !f.ownerCt.ownerCt.ownerCt.hidden && !f.ownerCt.ownerCt.ownerCt.collapsed ) {
alert ( "!f.ownerCt.ownerCt.ownerCt.hidden" );
}
else
f.ownerCt.ownerCt.ownerCt.show();
}
else
f.ownerCt.ownerCt.show();
}
else {
if ( f.ownerCt.hidden ) f.ownerCt.show ();
else f.ownerCt.expand();
}
}
else
f.ownerCt.show();
}
valid = false;
}
});
}
}
},{
text: 'Cancel'
}]
});

fsf.render(document.body);
});

Thylia
28 Sep 2010, 8:36 AM
Patch to fix the problem


Ext.override(Ext.Component, {
isVisible : function(){
return this.rendered && this.getVisibilityEl().isVisible(true);
}
});

Jamie Avins
4 Oct 2010, 9:10 AM
I understand the issue, but not your fix.