Sophie
Posts: 0
Joined: Tue Mar 04, 2014 4:30 pm

Tabs widgets

Hello,

Is there a way to have tabs widgets with appery ?
http://jqueryui.com/tabs/

Thank you in advance.

Sophie.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Tabs widgets

Hi Sophie,

Sure. Add HTML component with the following layout:precode<div id="tabs">
<ul>
<li><a href="#tabs-1">Nunc tincidunt</a></li>
<li><a href="#tabs-2">Proin dolor</a></li>
<li><a href="#tabs-3">Aenean lacinia</a></li>
</ul>
<div id="tabs-1">
<p><strong>Click this tab again to close the content pane&#46;</strong></p>
<p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus&#46; Curabitur nec arcu&#46; Donec sollicitudin mi sit amet mauris&#46; Nam elementum quam ullamcorper ante&#46; Etiam aliquet massa et lorem&#46; Mauris dapibus lacus auctor risus&#46; Aenean tempor ullamcorper leo&#46; Vivamus sed magna quis ligula eleifend adipiscing&#46; Duis orci&#46; Aliquam sodales tortor vitae ipsum&#46; Aliquam nulla&#46; Duis aliquam molestie erat&#46; Ut et mauris vel pede varius sollicitudin&#46; Sed ut dolor nec orci tincidunt interdum&#46; Phasellus ipsum&#46; Nunc tristique tempus lectus&#46;</p>
<>
<div id="tabs-2">
<p><strong>Click this tab again to close the content pane&#46;</strong></p>
<p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc&#46; Duis scelerisque molestie turpis&#46; Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor&#46; Aenean aliquet fringilla sem&#46; Suspendisse sed ligula in ligula suscipit aliquam&#46; Praesent in eros vestibulum mi adipiscing adipiscing&#46; Morbi facilisis&#46; Curabitur ornare consequat nunc&#46; Aenean vel metus&#46; Ut posuere viverra nulla&#46; Aliquam erat volutpat&#46; Pellentesque convallis&#46; Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis&#46; Mauris consectetur tortor et purus&#46;</p>
<>
<div id="tabs-3">
<p><strong>Click this tab again to close the content pane&#46;</strong></p>
<p>Duis cursus&#46; Maecenas ligula eros, blandit nec, pharetra at, semper at, magna&#46; Nullam ac lacus&#46; Nulla facilisi&#46; Praesent viverra justo vitae neque&#46; Praesent blandit adipiscing velit&#46; Suspendisse potenti&#46; Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio&#46; Nam scelerisque&#46; Donec non libero sed nulla mattis commodo&#46; Ut sagittis&#46; Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede&#46; Aenean vehicula velit eu tellus interdum rutrum&#46; Maecenas commodo&#46; Pellentesque nec elit&#46; Fusce in lacus&#46; Vivamus a libero vitae lectus hendrerit hendrerit&#46;</p>
<>
<>/code/pre
Then run this code on Load event:precode$( "#tabs" )&#46;tabs({
collapsible: true
});/code/pre

Sophie
Posts: 0
Joined: Tue Mar 04, 2014 4:30 pm

Tabs widgets

Hi Katya,

Thank you for your anwser.
The idea is to insert components into tabs.

Is there a way to do this?

Thank you in advance.

Sophie.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Tabs widgets

Hi Sophie.

Yes it's possible. Not easy but possible.

Please follow these steps:

1 Add html component into the page. Give it name "yourTabsMainContainer". Set "DIV" type for this component.

2 Add new htmlComonent inside "yourTabsMainContainer" and give it name "firstTab". Set "DIV" type for this component. This is container for your first tab. You can put inside controls you need.

3 Add new htmlComonent inside "yourTabsMainContainer" and give it name "secondTab". Set "DIV" type for this component. This is container for your second tab. You can put inside controls you need.

4 Add new htmlComonent inside "yourTabsMainContainer" component. And fill it with following html code:

pre
code

<div id="tabs">
<ul>
<li><a href="#Screen7_firstTab">Nunc tincidunt</a></li>
<li><a href="#Screen7_secondTab">Proin dolor</a></li>
</ul>

<>

/code
/pre

5 On "page show" js event handler add following code:

pre
code

Apperyio("yourTabsMainContainer")&#46;tabs({
collapsible: true
});

/code
/pre

You need to get something like this after: http://prntscr.com/3iez2a/direct

So there is main html(div) component and 3 other inside. First - tabs. And other two - tabs content.

Note: all HTML components should have dimensions: "auto", "auto"

Regards.

Sophie
Posts: 0
Joined: Tue Mar 04, 2014 4:30 pm

Tabs widgets

Hi Yurii,

It's great that this is possible.
Thank you very much.

I tried but I do not have tabs but simple links.
Should do some thing with CSS ?
I can not understand why it does not work.

Image

Image

Best regards.

Sophie.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Tabs widgets

Hi Sophie.

You can use HTML you need.

So simple example is just to use as HTML for tabs following code:

pre
code

<div id="tabs" data-role="navbar">
<ul>
<li><a href="#Screen7_firstTab" data-ajax="false">one</a></li>
<li><a href="#Screen7_secondTab" data-ajax="false">two</a></li>
</ul>
<>

/code
/pre

And after this change you will get this result http://prntscr.com/3iqvba/direct

Also: don't forget this code in page show event:

pre
code

Apperyio("yourTabsMainContainer")&#46;tabs({
collapsible: true
});

/code
/pre

If you have a problem plese give us public link to your app. And describe steps to reproduce it.

Regards.

Return to “Issues”