解决办法:使用remove(id)方法移除表单,可得到有效的form
原因:未知,希望大家补充
补充:下面是一个我遇到问题代码的简化版本,没有经过测试,大概意思是要是在form里想控制不显示表单,用remove()方法有效
实现代码如下:
new Ext.form.FormPanel({
id : 'ReportForm',items : [{
{id:"001"},
{id:"002"},
{id:"003"},
{id:"004"},
{id:"005"}
}]
});
//Ext.getCmp("ReportForm").getForm().isValid()验证无效
if(isTQ == 0){
Ext.getCmp("003").hide();
}
//Ext.getCmp("ReportForm").getForm().isValid()验证无效
if(isTQ == 0){
Ext.getCmp("003").siteVisible(false);
}
//Ext.getCmp("ReportForm").getForm().isValid()验证有效
if(isTQ == 0){
Ext.getCmp("ReportForm").remove("003");
}
以上就是【关于Ext中form移除textfield方法:hide(),setVisible(false),remove()】的全部内容了,欢迎留言评论进行交流!