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