javascript - Issue with open tab group in titanium -
javascript - Issue with open tab group in titanium -
i have 4 tabs in tab group. tab transition on click of tab names working fine. need open tab2 tab3 on click of button event in tab3. how can that.
sample code,
<alloy> <tab id="one"> <window class="container"> <label>this home view</label> </window> </tab> <tab id="two"> <window class="container"> <label>this sec view</label> </window> </tab> <tab id="three"> <window class="container"> <button onclick="savelang">proceed</button> </window> </tab> </alloy>
controller:
function savelang() { // how can open tab2 here // tried open index, loading time taking long , opening tab1 need open tab2 event }
i not on scheme , still few issues/comments can mention :
firstly uncertainty tabs not work not enclosed in tabgroup.
so view should :
<alloy> <tabgroup id="mytabgrp"> //tabgroup added <tab id="one"> <window class="container"> <label>this home view</label> </window> </tab> <tab id="two"> <window class="container" id="wintwo"> <label>this sec view</label> </window> </tab> <tab id="three"> <window class="container"> <button onclick="savelang">proceed</button> </window> </tab> </tabgroup> </alloy>
now when savelang
method gets called in controller can phone call setactivetab
method:
function savelang() { $.mytabgrp.setactivetab($.two); }
edit : reloading/refreshing content of window in tab , add together focus event of window in controller :
$.wintwo.addeventlistener('focus',function(e) { alert('focus'); });
hope helpful.
javascript iphone titanium titanium-mobile titanium-alloy
Comments
Post a Comment