【问题标题】:dijit/form/Select is not working properly in both Emulator and Simulatordijit/form/Select 在模拟器和模拟器中都不能正常工作
【发布时间】:2013-09-23 06:17:16
【问题描述】:

我在我的应用程序中使用 dijit/form/Select 来动态绑定一些数据。我能够将数据绑定到 Select 元素,但问题是我的 Select 元素在我的模拟器和模拟器中都没有正确呈现。我在 worklight 中使用嵌入式 dojo 1.9,下面是我正在使用的代码。我还需要在代码中添加什么才能使用 dijit select 吗?我在此论坛中搜索了此类问题,发现此链接用户遇到了同样的问题,但没有得到解答。

script error on require "dijit/form/Select"

我的 HTML 代码-

     <select  id="selectCity" name="selectCity" data-dojo-type="dijit/form/Select">

     </select>

我的脚本代码-

      <script type="text/javascript" src="dojox/mobile/deviceTheme.js"></script>
       <script type="text/javascript" data-dojo-config="isDebug: false, async: true,   parseOnLoad: true, mblHideAddressBar: false" src="dojo/dojo.js"></script>

【问题讨论】:

    标签: ibm-mobilefirst dojo


    【解决方案1】:

    我很确定这是因为dojox/mobile 中的主题与dijit 中的主题不同。要使用dijit 模块使用下拉菜单,您必须配置a theme。通常这意味着您需要导入一个 CSS 文件并向父元素添加一个类(最常见的做法是将其添加到您的 &lt;body&gt; 标记中)。但这些主题并非特定于设备。

    更好的解决方案是使用dojox/mobile/ComboBox,更多信息请访问reference guide

    【讨论】:

    • 知道了。谢谢迪米特里。
    猜你喜欢
    • 1970-01-01
    • 2014-07-27
    • 2020-08-14
    • 2015-09-27
    • 1970-01-01
    • 2019-11-13
    • 2012-10-25
    • 1970-01-01
    • 2018-04-08
    相关资源
    最近更新 更多