2
我正在使用Kendo的iPad應用程序和DropDownList正在拋出一個ActionSheet。我想強制它使用Web UI列表樣式。我怎樣才能做到這一點?強制DropDownList使用列表而不是ActionSheet的移動
我正在使用Kendo的iPad應用程序和DropDownList正在拋出一個ActionSheet。我想強制它使用Web UI列表樣式。我怎樣才能做到這一點?強制DropDownList使用列表而不是ActionSheet的移動
對於任何有興趣的人,我都能夠解決一個問題。這是一個接受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 }