I have a tab bar w/ scrolling enabled. I am dynamically adding tabs based on user input using addLast. When I have added enough tabs to trigger the scrolling, the newly created tab is not visible.
I’m using the length and ensureVisible methods, but it doesn’t appear to be working:
function add_tab(label, src) {
var length = $('#jqxTabs').jqxTabs('length') - 1;
$('#jqxTabs').jqxTabs('addLast', label, '');
$('#jqxTabs').jqxTabs('ensureVisible', length);
}
Edit: Okay, figured this out too. Length appears to start at 1 and the ensureVisble seems to start at 0. If I get the length before the add I don’t need to do the – 1. If I were to get the length after the add I would need the – 1. Adding information on what position your arrays/counts start at in the documentation would be helpful.