jQWidgets Forums

jQuery UI Widgets Forums Navigation Tabs Adding dynamically jqxWidgets content to Tabs

This topic contains 5 replies, has 3 voices, and was last updated by  vsukhwal 8 years, 7 months ago.

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

  • SarahLou
    Participant

    Hello team,

    I want to add dynamically some content to a new tab of jqxTabs. So I tried to clone the html… But since the content is already composed with jqxWidgets, jqwidgets don’t respond to the change which is normal because I have cloned just the HTML :/

    Please, how can I do the initialization and the creation of jqxwidgets dynamically?

    Here you can see a sample:
    https://www.jseditor.io/?key=adding-dynamically-content-to-tab

    Thank you so much for your time.

    Sarah


    SarahLou
    Participant

    Can anybody help me please? I still haven’t figured it out 🙁


    Ivo Zhulev
    Participant

    Hey Sarah,

    Did you share the demo to all? Because i cant open it.

    Best Regards,
    Ivo

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


    SarahLou
    Participant

    Sorry I didn’t pay attention to it. It’s now shared with everyone.

    Thank’s!


    Ivo Zhulev
    Participant

    Hi SarahLou,

    I would suggest you to have a function which will append the HTML needed for the widgets to the document and another function with the widgets itself.
    That way every time you create a new tab you will first call the HTML function which will append the needed HTML then you will can the widgets function which will create fresh widgets based on that HTML. Just dont forget to change the HTML and Widgets ID’s for every tab.

    Best Regards,
    Ivo

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


    vsukhwal
    Participant

    I am stuck at something similar. I want to bind the html data to the dynamically created node.

    I am using code:
    $scope.addtab = function () {
    tabs.addLast(‘Sample title’,loadPage(‘TOSview.html’,tabs.val()));
    tabs.ensureVisible(-1);

    };

    var loadPage = function (url, tabIndex) {
    $.get(url, function (data) {
    console.log(data);
    // dynamically appends data returned from a server to a content element with ID equal to “content1”
    // for the first tab, “content2” for the second tab or “content3” for the third tab.
    // $(‘#content’ + tabIndex).html(data);
    $(‘#Sample title’).html(data);
    });
    }

    But, its not working.. I see undefined in the content section. My url is only fetching <h1>Hello world</h1>

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

You must be logged in to reply to this topic.