EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: rezzonico on September 23, 2015, 07:44:18 AM



Title: Closing a tab
Post by: rezzonico on September 23, 2015, 07:44:18 AM
Hi all,

I have file1.html that create a easyui-tab with the name "List".
The easyui-tab "List" call file11.html.
file11.html create two other tab: AAA and BBB
All works ok.
In the following link you can try it:
http://195.144.40.170/CCC/file1.html

Now in file11.html I add the following code in order to close tab "BBB".
   <script type="text/javascript">
      $(function() {
         $('#tt11').tabs('close', 'BBB');
      });
   </script>


As you can try in the following link I receive an error.
http://195.144.40.170/CCC/file2.html

Any help to solve this problem is appreciated.

Regards.
Miche





Title: Re: Closing a tab
Post by: stworthy on September 23, 2015, 08:00:29 AM
When loading a content page, the script in the content page runs immediately but at this time the tabs component hasn't been created. To solve this issue, create the tabs before calling 'close' method.
Code:
$('#tt11').tabs();  // create the tabs component
$('#tt11').tabs('close', 'BBB');


Title: Re: Closing a tab
Post by: rezzonico on September 25, 2015, 01:54:10 AM
Thanks for your help.

Miche