EasyUI Forum
October 19, 2025, 11:36:57 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: get parent tab of a nested tab  (Read 8505 times)
Shanthi
Newbie
*
Posts: 3


View Profile
« on: August 08, 2016, 07:53:51 AM »

Hi,

I have the below markup: (nested tabs)
<div id="tt" class="easyui-tabs" data-options="tabWidth:275" style="width:1600px;height:850px;">
     <div title="Neo Lab" style="padding:20px;display:none;">
             <div id="neoLab" class="easyui-tabs" data-options="fit:true,plain:true">
                  <div id="getStrtd" title="Getting Started" data-options="tabWidth:200" style="padding:10px;"></div>
             </div>

             <div id="reportsLab" class="easyui-tabs" data-options="fit:true,plain:true">
                  <div id="getStrtd1" title="Getting Started" data-options="tabWidth:200" style="padding:10px;"></div>
             </div>

    </div>
</div>

I am doing the same action in both the tabs and in my code. I am need to assign the panel where the content should be loaded.

How do I get the parent tab of the selected tab:
for eg: I need to get the value as "reportsLab' or 'neoLab'.

I am able to get the element id of the child tab using the below code:

var imselectedTab = $('#neoLab').tabs('getSelected');
var imtitle = imselectedTab.panel('options').id;

How do I get the element id of its parent? i tried
var imselectedTab = $('#tt').tabs('getSelected');

This didnt work... Please give me a solution...
Logged
jarry
Administrator
Hero Member
*****
Posts: 2300


View Profile Email
« Reply #1 on: August 08, 2016, 06:02:44 PM »

The 'id' value of your parent tabs component is 'tt'. Calling $('#tt') will get the parent tabs object. To get the parent tab panel, please call $('#tt').tabs('getSelected'). This statement will return the current selected tab panel. i.e. the 'Neo Lab' panel.
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!