nativeDroid2
nativeDroid2 copied to clipboard
Dynamic n2tabs creation
#55
Hi to all,
i'm triyng to create dynamic n2tabs with mustache.js, all data and html are filled but not rendered correctly
n2tabs and n2tab data are populated in 'pagebeforeshow'.
Any advice?
Thank you in advance. Vincenzo
Hi Vincenzo,
so...by this is little bit hard to give you a right answer. It can be or css override or the fact that you take that data from a jquery request. so you should refresh. Can you give us source ?
Hi When you dynamically create the nav and the tabs, you also have to include these classes : nd2Tabs-nav-item
and nd2Tabs-content-tab
on appropriate tags, which are normally added into the dom, by the library on init.
Doesn't work here either.
<ul data-role="nd2tabs" data-swipe="true">
<li data-tab="tab-club">A</li>
<li data-tab="tab-meetings">B</li>
<li data-tab="tab-members">C</li>
</ul>
<div data-role="nd2tab" data-tab="tab-club">
A</div>
<div data-role="nd2tab" data-tab="tab-meetings">
B</div>
<div data-role="nd2tab" data-tab="tab-members">
C</div>
The "nd2Tabs-nav-item" class must only be added to <li data-tab="...">
tags, not <ul>
. And you have to add the "nd2Tabs-content-tab" class to the <div data-role="nd2-tab" data-tab="..." >
tags. Then it should work.
Try this in the end code ajax:
$("[data-role='nd2tabs']").tabs()