DropDownButton 中的 TooltipDialog 不适用于自定义小部件
TooltipDialog inside DropDownButton not working for custom widget
使用了 https://dojotoolkit.org/reference-guide/1.10/dijit/form/DropDownButton.html
中的示例
<div data-dojo-type="dijit/form/DropDownButton">
<span>Register</span>
<div data-dojo-type="dijit/TooltipDialog">
<label for="name">Name:</label> <input data-dojo-type="dijit/form/TextBox" id="name" name="name"><br>
<label for="hobby">Hobby:</label> <input data-dojo-type="dijit/form/TextBox" id="hobby" name="hobby"><br>
<button data-dojo-type="dijit/form/Button" type="submit">Save</button>
</div>
</div>
并将其放入自定义小部件中。单击时发生错误:
Uncaught TypeError: Cannot read property 'on' of null
错误仅发生在我的自定义小部件上。使用在其他页面上截取的代码效果很好。
答案是自定义小部件在没有 this.inherited(arguments)
的情况下覆盖了 startup()
函数。
看起来有一些 DropDownButton
魔法正在那里发生..
使用了 https://dojotoolkit.org/reference-guide/1.10/dijit/form/DropDownButton.html
中的示例<div data-dojo-type="dijit/form/DropDownButton">
<span>Register</span>
<div data-dojo-type="dijit/TooltipDialog">
<label for="name">Name:</label> <input data-dojo-type="dijit/form/TextBox" id="name" name="name"><br>
<label for="hobby">Hobby:</label> <input data-dojo-type="dijit/form/TextBox" id="hobby" name="hobby"><br>
<button data-dojo-type="dijit/form/Button" type="submit">Save</button>
</div>
</div>
并将其放入自定义小部件中。单击时发生错误:
Uncaught TypeError: Cannot read property 'on' of null
错误仅发生在我的自定义小部件上。使用在其他页面上截取的代码效果很好。
答案是自定义小部件在没有 this.inherited(arguments)
的情况下覆盖了 startup()
函数。
看起来有一些 DropDownButton
魔法正在那里发生..