nativeDroid2 icon indicating copy to clipboard operation
nativeDroid2 copied to clipboard

Dynamic n2tabs creation

Open vamoruso opened this issue 9 years ago • 5 comments

#55

Hi to all, i'm triyng to create dynamic n2tabs with mustache.js, all data and html are filled but not rendered correctly 2016-02-03_11-21-37

n2tabs and n2tab data are populated in 'pagebeforeshow'.

Any advice?

Thank you in advance. Vincenzo

vamoruso avatar Feb 03 '16 10:02 vamoruso

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 ?

well-it-wasnt-me avatar Feb 20 '16 14:02 well-it-wasnt-me

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.

nabil-g avatar Feb 02 '17 21:02 nabil-g

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>

webrtd avatar Feb 05 '17 18:02 webrtd

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.

nabil-g avatar Feb 05 '17 20:02 nabil-g

Try this in the end code ajax:

$("[data-role='nd2tabs']").tabs()

damtaipu avatar Feb 26 '19 14:02 damtaipu