Ext使用form布局时 使用hide()方法或者setVisible()隐藏textfile 等组件 filedLable不隐藏问题

来源:互联网 发布:日进斗金软件 编辑:程序博客网 时间:2024/05/23 01:18

http://www.sencha.com/forum/showthread.php?25479-2.0.1-2.1-%20%20Field.destroy%28%29-on-Fields-rendered-by-FormLayout-does-not-clean-up.&p=120152#post120152


For Ext 3.0.0

Ext.override(Ext.layout.FormLayout, {
renderItem : function(c, position, target){
if(c && !c.rendered && (c.isFormField || c.fieldLabel) && c.inputType != 'hidden'){
var args = this.getTemplateArgs(c);
if(typeof position == 'number'){
position = target.dom.childNodes[position] || null;
}
if(position){
c.itemCt = this.fieldTpl.insertBefore(position, args, true);
}else{
c.itemCt = this.fieldTpl.append(target, args, true);
}
c.actionMode = 'itemCt';
c.render('x-form-el-'+c.id);
c.container = c.itemCt;
c.actionMode = 'container';
}else {
Ext.layout.FormLayout.superclass.renderItem.apply(this, arguments);
}
}
});
Ext.override(Ext.form.Field, {
getItemCt : function(){
return this.itemCt;
}
});


For Ext 3.0.1

Ext.layout.FormLayout.prototype.trackLabels = true;

原创粉丝点击