jQWidgets Forums
jQuery UI Widgets › Forums › Navigation › Tabs › Adding dynamically jqxWidgets content to Tabs
Tagged: add Tab jqxwidgets dynamically
This topic contains 5 replies, has 3 voices, and was last updated by vsukhwal 8 years, 7 months ago.
-
Author
-
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-tabThank you so much for your time.
Sarah
Can anybody help me please? I still haven’t figured it out
Hey Sarah,
Did you share the demo to all? Because i cant open it.
Best Regards,
IvojQWidgets Team
http://www.jqwidgets.com/Sorry I didn’t pay attention to it. It’s now shared with everyone.
Thank’s!
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,
IvojQWidgets Team
http://www.jqwidgets.com/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>
-
AuthorPosts
You must be logged in to reply to this topic.