我使用Dojo开发了Worklight Hybrid应用程序。在我的项目中,我有一个使用dojox.mobile.combobox.
我的问题是当在一个页面中打开ComboBox并导航到视图时,组合框的下拉部分保持可见。
答案 0 :(得分:0)
请参阅此dojo-toolkit讨论主题,描述相同的现象:http://dojo-toolkit.33424.n3.nabble.com/Dropdown-combobox-doesn-t-dissapear-tt3992812.html#none
下载此示例项目,其中包含已实施的解决方法(在Dojo Mobile团队开发人员的帮助下):Worklight 6.1.0-based Dojo app with ComboBox
需求函数中的解决方案如下:
require([ "dojo/_base/connect", "dojo/_base/window", "dojo/ready", "dojo/dom",
"dijit/registry", "dojo/parser", "dojox/mobile",
"dojox/mobile/Heading", "dijit/form/DataList", "dojox/mobile/ComboBox", "dojox/mobile/View",
"dojox/mobile/Button", "dojox/mobile/RoundRectList", "dojox/mobile/ListItem" ],
function(connect, win, ready, dom, registry) {
ready(function() {
var combo1 = registry.byId("combo1");
var combo2 = registry.byId("combo2");
connect.subscribe("/dojox/mobile/beforeTransitionIn",
function(view, moveTo, dir, transition, context, method){
combo1.closeDropDown();
combo2.closeDropDown();
});
}
);
});