EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jvels on September 07, 2013, 11:17:30 AM



Title: onselect for a specfic tab
Post by: jvels 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


Title: Re: onselect for a specfic tab
Post by: chrwei on September 12, 2013, 08:39:46 AM
do index and hest not have the same value?