2013-08-28 68 views

回答

0

對於任何有興趣的人,我都能夠解決一個問題。這是一個接受kendoMobileView作爲參數並應用修復的函數。

//Hack to force dropdowns to act like comboboxes in mobile! 
 
\t utils.fix.dropdownlists = function(view) { 
 
     var dropdowns = view.element.find("[data-role='dropdownlist']"); 
 
     //Iterate through dropdown elements 
 
     _.each(dropdowns, function(item){ 
 
     var comp = $(item).data("kendoDropDownList"); 
 
     if(comp && comp.popup) { 
 
      comp.popup.bind("open", function(event){ 
 
      event.sender.element.parent().removeClass("km-popup km-widget"); 
 
      if(event.sender.element.parent().hasClass("km-popup")) { 
 
       //Prevent default open animation. 
 
       //Then remove classes and open the popup programitcally 
 
       //Easy peasy, Lemon squeezy 
 
       event.preventDefault(); 
 
       event.sender.element.parent().removeClass("km-popup km-widget"); 
 
       setTimeout(function(){ 
 
       event.sender.open(); 
 
       },0); 
 
      } 
 
      }); 
 
     } 
 
     }); 
 
\t }

相關問題