EasyUI Forum
September 14, 2025, 06:55:27 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Closing a tab  (Read 8879 times)
rezzonico
Full Member
***
Posts: 186


View Profile
« 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



Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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');
Logged
rezzonico
Full Member
***
Posts: 186


View Profile
« Reply #2 on: September 25, 2015, 01:54:10 AM »

Thanks for your help.

Miche
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!