jQWidgets Forums

jQuery UI Widgets Forums Navigation Tabs jqxTabs value for tab

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 11 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • jqxTabs value for tab #47192

    Makla
    Participant

    I am using tabclick event. The handler function has one parameter: event, from which I can get index of a tab. This is nice, but impracticality for my case. I need to store some ID (from mysql table) so I can act properly.
    Tabs are made from <li>, but <li> has also a value.
    So, I use this:

    <div id='jqxTabsGraph'>
        <ul style='margin-left: 20px;'>
            <li value="15">Omara</li>
            <li value="16">Kavč</li>   					
        </ul>
        <div></div>
        <div></div>			    
    </div>

    How can I get the value (15 or 16) from $(‘#jqxTabsGraph’).on(‘tabclick’, function (event) ?

    jqxTabs value for tab #47280

    Dimitar
    Participant

    Hello Makla,

    Here is how to achieve this requirement:

    $("#jqxTabsGraph").on("tabclick", function (event) {
        var index = event.args.item;
        var tabsLi = $("#jqxTabsGraph ul:eq(0)").children();
        var currentValue = tabsLi[index].value;
        alert(currentValue);
    });

    Best Regards,
    Dimitar

    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.