EasyUI Forum
May 04, 2024, 06:10:29 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: onselect for a specfic tab  (Read 7359 times)
jvels
Newbie
*
Posts: 3


View Profile
« on: September 07, 2013, 11:17:30 AM »

Hi

I have some tabs, and want to do a onselect for a specific tab. I have this code, it works, but I think it can be done more "smooth" (do the on select for a specific tab)

Code:
$(document).ready(function(){


$('#tttabs').tabs({
    onSelect: function(title, index){

var tab = $('#tttabs').tabs('getSelected');
var hest = $('#tttabs').tabs('getTabIndex',tab);
//alert(hest);
if(hest == 1) {


//////////////////////////////////////////////
$('#left option').each(function(index, option) {
$(option).remove();
});
////////////////////////
  $.getJSON('selectMenus.php', function(data){
        $.each(data, function(index,item) {
           $("#left").append("<option value=" + item.phone+ ">" + item.firstname + " " + item.lastname +"</option>");
    });
    });

////////////////////
}
    }       
});

});

/Jesper
Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #1 on: September 12, 2013, 08:39:46 AM »

do index and hest not have the same value?
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!