For many reasons I am using a tab strip as action buttons on a form instead of buttons.
First question:
I want to be able to deselect a tab once I have called its action. For example I have the following snippet.
<div data-role="footer">
<div data-role="tabstrip" id="tabstrip" data-select="onTabSelected">
<a data-icon="home">Save</a>
<a data-icon="info">Previous</a>
<a data-icon="details">Next</a>
<a data-icon="camera">Scan</a>
</div>
</div>
And here is the select event
function onTabSelected(e)
{
var index = $(e.item).index();
console.log("tab index="index);
if(index == 1)
{
// do something
}
else if(index == 2)
{
// do something
}
// deselect the tab item so the user can select it again and fire the select event
return;
}
Second question:
Can I use standard jquery icons like data-icon="ui-icon-carat-1-e"
Thanks in advance
First question:
I want to be able to deselect a tab once I have called its action. For example I have the following snippet.
<div data-role="footer">
<div data-role="tabstrip" id="tabstrip" data-select="onTabSelected">
<a data-icon="home">Save</a>
<a data-icon="info">Previous</a>
<a data-icon="details">Next</a>
<a data-icon="camera">Scan</a>
</div>
</div>
And here is the select event
function onTabSelected(e)
{
var index = $(e.item).index();
console.log("tab index="index);
if(index == 1)
{
// do something
}
else if(index == 2)
{
// do something
}
// deselect the tab item so the user can select it again and fire the select event
return;
}
Second question:
Can I use standard jquery icons like data-icon="ui-icon-carat-1-e"
Thanks in advance