2013-11-27 72 views
0

這是我KendoUI移動應用程序的骨架:我希望關閉抽屜打開配置移動不起作用

var app = new kendo.mobile.Application($(document).body,{ 
    init: function(){ 
     app.navigate('#user-view'); 
    } 
}); 

    .... 

app.initialize = function() { 
    this.bindEvents(); 
}; 
app.bindEvents = function() { 
    document.addEventListener('deviceready', this.onDeviceReady, false); 
}; 
app.onDeviceReady = function() { 
    .... 
}; 

<html> 
    <head> 
     <meta charset="utf-8" /> 
     <meta name="format-detection" content="telephone=no" /> 
     <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" /> 
     <!-- Kendo UI Mobile CSS --> 
     <link href="styles/kendo.mobile.all.min.css" rel="stylesheet" /> 
     <!-- jQuery JavaScript --> 
     <script src="js/jquery.min.js"></script> 
     <!-- Kendo UI Mobile combined JavaScript --> 
     <script src="js/kendo.mobile.min.js"></script> 
     <title>Degrado Ambientale</title> 
    </head> 
    <body> 

     <!-- View Map --> 
     <div data-role="view" data-title="Degrado Ambientale" id="map-view" data-layout="default" data-stretch="true"> 
      ... 
     </div> 

     <!-- View List --> 
     <div data-role="view" data-title="Degrado Ambientale" id="list-view" data-layout="default" data-show="app.getDataFromServer" > 
      ... 
     </div> 

     <!-- View New --> 
     <div data-role="view" data-title="Degrado Ambientale" id="new-view" data-layout="default" data-show="app.clearRepo"> 
      ... 
     </div> 

     <!-- View User --> 
     <div data-role="view" data-title="Degrado Ambientale" id="user-view" data-use-native-scrolling="true" class="newformstyle" data-show="app.showOptionView" data-init="app.initOptionView"> 
      ... 
     </div> 

     <!-- View Dettagli Segnalazione --> 
     <div data-role="view" id="view-repoDetail" style="width: 100%; height: 100%" data-show="app.loadRepo"> 
      ... 
     </div> 

     <!-- Default Layout --> 
     <div data-role="layout" data-id="default"> 
      <div data-role="header"> 
       <div data-role="navbar"> 
        <a data-role="button" data-rel="drawer" href="#drawer" data-icon="drawer-icon" data-align="left"></a> 
        <span data-role="view-title"></span> 
       </div> 
      </div> 
     </div> 

     <!-- Drawer --> 
     <div data-role="drawer" data-views='["map-view", "list-view", "new-view"]' data-swipe-to-open="false" id="drawer"> 
      <ul data-role="listview" data-type="group"> 
       <li>Men&ugrave 
        <ul> 
         <li data-icon="globe"><a href="#map-view" data-transition="none">Mappa</a></li> 
         <li data-icon="list-icon"><a href="#list-view" data-transition="none">Segnalazioni</a></li> 
         <li data-icon="compose"><a href="#new-view" data-transition="none">Segnala</a></li> 
        </ul> 
       </li> 
       <li>Opzioni 
        <ul> 
         <li data-icon="contacts"><a href="#user-view" data-transition="none">Utente</a></li> 
        </ul> 
       </li> 
      </ul> 
     </div> 

     <script type="text/javascript" src="phonegap.js"></script> 
     <script type="text/javascript" src="javascript/index.js"></script> 
     <script type="text/javascript"> 
      app.initialize(); 
     </script> 
    </body> 
</html> 

javascript/index.js是滑動和抽屜只能顯示在ID爲:地圖視圖,列表視圖和新視圖的視圖上。

爲此,我設置抽屜配置屬性:

  • data-swipe-to-open"false";
  • data-views'["map-view", "list-view", "new-view"]'

但抽屜沒有出現在任何觀點。如果我刪除data-views配置,則抽屜會通過滑動顯示在所有視圖中。

回答

0

WRT數據刷卡問題 - Kendo中存在一個已知問題,它在Android上不起作用(您仍然可以輕掃以打開菜單 - 在iOS上可以正常工作)。

我下載了kendoui.c​​omplete.2013.3.1324.trial,並提取了kendo.mobile.min.js和css文件,並解決了問題。