2013-10-29 22 views
0

我嘗試在雙擊事件(在表字段)上顯示彈出窗口,所以我通過敲除方法添加此操作。這個事件在瀏覽器中可用,但它不適用於ios或android平臺。我應該怎麼做才能解決這個問題?雙擊不能在iOS和Android上運行(PhoneJS)

<div class="contentContainer" data-bind="dxScrollView: { direction: 'vertical' }"> 
      <div class="dx-fieldset"> 
       <div data-bind="foreach: finalDataSource"> 
        <div class="dx-field"> 
         <div class="dataKey dx-field-label" data-bind="text: $data.ColumnName, event: { dblclick: $root.showPopup }"></div> 
         <div class="dataValue inp dx-field-value" data-bind=" 
    dxTextBox: { enable: false, value: $data.Value, clickAction: $root.inpClick }"> 
         </div> 
        </div> 

       </div> 
      </div> 
     </div> 



    function showPopup(sender) { 
     MyApp.app.column.id(sender.ColumnId); 
     MyApp.app.column.name(sender.ColumnName); 
     getPopupDataSource(); 
     popupVisible(true); 
    } 

回答

1

問題是這個動作是在 「viewShown」

現在開始了我的彈出窗口doubleTap事件hammer.js

var elements = document.getElementsByClassName('dataKey'); 
      for (i = 0; i < elements.length; i++) { 
       Hammer(elements[i]).on("doubletap", function (event) { 
        showPopup(ko.dataFor(event.srcElement)); 
       }); 
      } 

解決。