jQWidgets Forums

jQuery UI Widgets Forums Navigation Tabs selectedEvent does not fire

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • selectedEvent does not fire #27859

    carlo
    Participant

    The selectEvent does not fire when a tab is selected by the program

    function test1()
    {
    $(‘#tbStationPages’).jqxTabs({ width: ‘100%’, height: 35, animationType: ‘none’, position: ‘top’ });
    $(‘#tbStationPages’).jqxTabs(‘removeFirst’);
    $(‘#tbStationPages’).jqxTabs(‘addLast’, “Tab1″, ”);
    $(‘#tbStationPages’).jqxTabs(‘addLast’, “Tab2″, ”);
    $(‘#tbStationPages’).jqxTabs(‘addLast’, “Tab3″, ”);
    $(‘#tbStationPages’).jqxTabs(‘addLast’, “Tab4″, ”);
    $(‘#tbStationPages’).on(‘selected’, Pages_selected);
    $(‘#tbStationPages’).jqxTabs({ selectedItem: 2 });

    }
    function Pages_selected(e)
    {
    alert(“page:” + e.args.item);
    }

    selectedEvent does not fire #27864

    Peter Stoev
    Keymaster

    Hi carlo,

    At the point you set selectedItem, there is an active animation which resizes the Tab’s UL after adding/removing items. That is the reason your Tab will not be selected and the event will not be called. An option is to call “selectedItem” in a setTimeout.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.