jQWidgets Forums

jQuery UI Widgets Forums Navigation Tabs jQuery arbitrary data disappears

This topic contains 5 replies, has 2 voices, and was last updated by  Peter Stoev 12 years, 4 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • jQuery arbitrary data disappears #14357

    lopez306
    Participant

    I store arbitrary data for every ‘li’ element using jQuery.data before jQWidgets-Tabs is created.
    After that, I initialize widget and when I wan’t to retrive stored data there isn’t.
    Are you clearing it for some reason ??

    jQuery arbitrary data disappears #14358

    Peter Stoev
    Keymaster

    Hi lopez306,

    To create jqxTabs, you should have a clean structure of UL and DIV tags for content. You can put anything inside the LI tags and inside the DIV tags. We clean all CSS classes and attributes from the LI and DIV tags, not from their content.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    jQuery arbitrary data disappears #14362

    lopez306
    Participant

    I am not talking about element content but jQuery data store.
    http://api.jquery.com/data/

    jQuery arbitrary data disappears #14363

    Peter Stoev
    Keymaster

    Hi lopez306,

    My post is valid for that, too.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    jQuery arbitrary data disappears #14364

    lopez306
    Participant

    Doesn’t work for me !!

    jQWidgets: 2.6.1
    jQuery: 1.9.0
    Browser: all of them

    Please open console and load page.

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>JQWidgets</title>
    <link rel="stylesheet" href="jqwidgets/styles/jqx.base.css?v=2.6.1" type="text/css" />
    <link rel="stylesheet" href="jqwidgets/styles/jqx.energyblue.css?v=2.6.1" type="text/css" />
    <script type="text/javascript" src="js/ext/jquery-1.9.0.js"></script>
    <script type="text/javascript" src="jqwidgets/jqxcore.js?v=2.6.1"></script>
    <script type="text/javascript" src="jqwidgets/jqxtabs.js?v=2.6.1"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    $('#li1').data('key1', 'value1');
    $('#li2').data('key2', 'value2');
    $('#li3').data('key3', 'value3');
    console.log('Before jqxTabs creation');
    console.log($('#li1').data('key1'));
    console.log($('#li2').data('key2'));
    console.log($('#li3').data('key3'));
    $('#jqxTabs').jqxTabs({ width: 300, height: 60, theme: 'energyblue' });
    console.log('After jqxTabs creation');
    console.log($('#li1').data('key1'));
    console.log($('#li2').data('key2'));
    console.log($('#li3').data('key3'));
    });
    </script>
    </head>
    <body class='default'>
    <div id='jqxWidget'>
    <div style='float: left;'>
    <div id='jqxTabs' style='float: left; margin-left: 20px;'>
    <ul>
    <li id="li1">Home</li>
    <li id="li2">Solutions</li>
    <li id="li3">Products</li>
    </ul>
    <div>Home content</div>
    <div>Solutions content</div>
    <div>Products content</div>
    </div>
    </div>
    </div>
    </body>
    </html>
    jQuery arbitrary data disappears #14365

    Peter Stoev
    Keymaster

    Hi lopez306,

    I am sorry about that, but that is the behavior of the widget at present. If you want to store custom data, you should not use the LI tags from the jqxTabs structure.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.