jQWidgets Forums

jQuery UI Widgets Forums Navigation Tabs AddLast & Scrolling

This topic contains 0 replies, has 1 voice, and was last updated by  shimmoril 12 years, 9 months ago.

Viewing 1 post (of 1 total)
  • Author
  • AddLast & Scrolling #7513

    shimmoril
    Participant

    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.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.