Methods for removing textfield from form in Ext: hide (), setVisible (false), remove ()

Source: Internet
Author: User

Problem: the original form verification is invalid when the hide () method and setvisible (false) method are used to remove the form from the items Center (a tail form has been removed in many examples ).
Solution: remove a form using the remove (id) method to obtain a valid form.
Cause: unknown. I hope you can add
Supplement: The following is a simplified version of the code that I encountered. It has not been tested. It means that the remove () method is valid if you want to control the form not displayed in form.
Copy codeThe Code is as follows:
New Ext. form. FormPanel ({
Id: 'reportform', items :[{
{Id: "001 "},
{Id: "002 "},
{Id: "003 "},
{Id: "004 "},
{Id: "005 "}
}]
});

// Ext. getCmp ("ReportForm"). getForm (). isValid () Verification is invalid
If (isTQ = 0 ){
Ext. getCmp ("003"). hide ();
}

// Ext. getCmp ("ReportForm"). getForm (). isValid () Verification is invalid
If (isTQ = 0 ){
Ext. getCmp ("003"). siteVisible (false );
}

// Ext. getCmp ("ReportForm"). getForm (). isValid () Verification is valid
If (isTQ = 0 ){
Ext. getCmp ("ReportForm"). remove ("003 ");
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.