Solution for disabling icon invalidation on the tab after easyui tabs update

Source: Internet
Author: User

Problem: When the easyui tabs component is used, the tab update method is called, and the closed icon on the updated tab is invalid.

 

The JS file used is jquery 1.3. easyui. min. JS file. when the close icon is added to the Add function by reading the source file, the close icon is bound to the click event, but the close icon is not bound to the click event in the update function, it is determined that the event to close the icon binding in the Add function is to close the tab event. The cause has been found, so you can close the icon binding event when executing the UPDATE function to close the tab to solve the problem described above.

 

Solution: Find the following code:

Tab. Find ("span. Tabs-title"). addclass ("tabs-closable ");

$ ("<A href = \" javascript: void (0) \ "class = \" tabs-close \ "> </a>"). appendto (Tab );

Replace the above Code with the following code to solve the above problem.

VaR _ CLSA = $ ("<a href = \" javascript: void (0) \ "class = \" tabs-close \ "> </a> "). appendto (Tab );
_ CLSA. BIND ("click", function (){
If ($ (this). Parent (). hasclass ("tabs-Disabled ")){
Return;
}
VaR tabs = $ (_ 2a2). Children ("Div. Tabs-header"). Find ("Ul. Tabs ");
VaR _ clsli = tabs. Find ("Li"). Index ($ (this). Parent ());
_ 29B (_ 2a2, _ clsli );
Return false;
});

 

Note that the modified Code is red above, and the new Code is blue.

Solution for disabling icon invalidation on the tab after easyui tabs update

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.