脚本错误需要“dijit / form / Select”

时间:2013-08-06 14:13:59

标签: dojo ibm-mobilefirst

此代码

require([ "dojo","dojo/request/script", "dojo/parser", "dojox/mobile", "dojox/mobile/compat", "dojox/mobile/deviceTheme",
              "dojox/mobile/ScrollableView",
              "dojox/mobile/ScreenSizeAware",
              "dojox/mobile/FixedSplitter",
              "dojox/mobile/ContentPane",


              "dijit/form/Select"
              ],

              function(dojo) {

添加Select时生成脚本错误。为什么? 我试试this但是没有用!

Error: multipleDefine


...on(h){return"[object Array]"==l.call(h)},g=function(h,a){if(h)for(var c=0;c<h.le...

dojo.js (line 2)
Error: scriptError

2 个答案:

答案 0 :(得分:1)

这适用于WL6中的默认dojo 1.9库:

function dojoInit() {
require([ "dojo", "dojo/ready", "dojo/parser", "dojox/mobile", "dojo/dom", "dijit/registry", "dojox/mobile/ScrollableView",
        "dijit/form/Select" ], function(dojo, ready) {
    ready(function() {

        new dijit.form.Select({
            name : "select2",
            options : [ {label : "TN",value : "Tennessee"}, 
                        {label : "VA",value : "Virginia",selected : true}, 
                        {llabel : "WA",value : "Washington"}, 
                        {label : "FL",value : "Florida"}, 
                        {label : "CA",value : "California"} ]
        }).placeAt(dojo.byId(view0));
    });
});
}

虽然小部件显示在应用程序中显得混乱,但没有错误。 (它有效,但看起来不正确)也许它需要一些CSS

答案 1 :(得分:0)

这通常意味着你有一个不同版本的dijit / form /选择定义的地方和他们的冲突