2013-06-18 61 views
0

我正在使用Kendo ui mobile。當屏幕截圖(Show Modal.png)中顯示選擇了tabstrip項目時,我打開一個模式視圖。在Kendo ui mobile中手動選擇tabstrip

enter image description here

在劍術UI移動標籤欄我防止默認事件傳播即通過使用e.preventDefault(),顯示確認對話框,顯示模態視圖的選擇方法如圖中截圖(Prevent Default Action.png)。

enter image description here

代碼: -

(HTML部分)

<div id='modal_tabs' data-role="tabstrip" data-select='tabChange'> 
    <a href="#index" data-icon="custom">Home</a> 
</div> 

(JS部分)

function tabChange(e) { 
    if (someCondition) { 
     e.preventDefault(); 
     showConfirmation(showPopUpMsg, 'Unsaved changes', doTabActiveOnOK); // show confirmation dialog box 
    } 
    doTabActiveOnOK = function (button) { // callback function 
     if (button == true) { // if ok button is pressed 
      $("#modal_tabs").data("kendoMobileTabStrip").select(1); // not supported 
     } 
    } 
} 

如果 '確定' 按鈕被按下,則確認對話框我想要再次執行默認操作(顯示模式)或選擇tabstrip ma nually。如何執行此任務?

回答

1

我不知道,如果你還需要這一點,但你可以使用switchTo,而不是選擇:

var tabStrip = $("#modal_tabs").data("kendoMobileTabStrip"); 
tabStrip.switchTo("#tabId"); 
+0

謝謝回答,但我已經改變了流動我不需要這個,現在。再次感謝您的幫助...... :) –

1
function ChangeTabStrip(DivID) { 
    var tabStrip = app.view().footer.find(".km-tabstrip").data("kendoMobileTabStrip"); 
    tabStrip.switchTo("#" + DivID); 
    app.navigate("#" + DivID, "slide"); 
} 
相關問題