"无法解析构造函数:'" dojox.mobile.TextBox"'"

时间:2014-12-23 05:57:26

标签: dojo

使用dojo内联模板时,我遇到以下问题:     我在html页面中创建模板,方法是在以下标签之间定义模板(它还集成了mvc)

    `<script id="createNewItem" type="text/template">
    <div>
    <div data-dojo-type='dijit/TitlePane' data-dojo-props='open:false'>
    <div class='accordionRev'>
    <input type="number" name="qty" placeholder="Quantity (required)" data-dojo-type="dojox.mobile.TextBox" class='quantity' data-dojo-props="value: at('rel:','quantity'), class:at('rel:', 'quantityErr')" onchange="cntrl.createQuoteFields(true, this, '{{lineNumber}}');" onkeypress="cntrl.quantityHandler.call(this, '{{lineNumber}}')" onpaste="cntrl.pastehandler.call(this)" tabindex=0/>
    </div>
   </div>
   </div>
   </script>'

I will be using this template in another page like this

`<ul id="rfqTitlePane" class="hide"
                data-dojo-type="dojox/mvc/WidgetList"
                data-dojo-mixins="dojox/mvc/_InlineTemplateMixin"
                data-dojo-props="children: at(cntrl.createQuoteList,'items').direction(at.from)"
                data-mvc-child-type="dojox/mvc/Templated"
                data-mvc-child-props="clickable: true, variableHeight: 'true', 
                indexAtStartup: this.indexAtStartup, 
                customTitle: at(this.target, 'title').direction(at.both),               titlePaneDOM:at(this.target,'displayDetails').direction(at.from).transform({format:custom.helpers.RequestMarkup})">
                <script type="dojox/mvc/InlineTemplate"> 
                     <li>
                            ${titlePaneDOM}
                    </li>
                </script>
            </ul>`

I am getting "Unable to resolve constructor for: '"dojox.mobile.TextBox"'" error. I actually defined textbox before the template gets loaded. I am not sure where its going wrong

1 个答案:

答案 0 :(得分:1)

似乎该问题包含错误的降价,因此我建议修复该问题,以便提供更好的答案。同时我可以说的一些事情是:

  • 您可能希望在运行模板之前尝试导入dojox / mobile / TextBox模块。
  • Dojo的最新版本更喜欢data-dojo-type中的AMD格式,例如data-dojo-typ="dojox/mobile/TextBox"
  • dojox / mvc / InlineTemplateMixin查看<script type="dojox/mvc/InlineTemplate">而不是<script type="text/template">

希望这有帮助。

Best,Akira