admin管理员组文章数量:1387360
<input type="text" name="date" value="" dojoType="dijit.form.DateTextBox" required="true" />
I want to avoid dojoType for 2 reasons:
parseonload makes it "jump" onload (you see system-default input-fields for some time onload)
It is not validating HTML
so whats the alternative?
<input type="text" name="date" value="" dojoType="dijit.form.DateTextBox" required="true" />
I want to avoid dojoType for 2 reasons:
parseonload makes it "jump" onload (you see system-default input-fields for some time onload)
It is not validating HTML
so whats the alternative?
Share Improve this question edited Nov 14, 2011 at 14:08 hugomg 70.1k29 gold badges165 silver badges255 bronze badges asked Nov 14, 2011 at 13:10 iceteeaiceteea 1,2243 gold badges20 silver badges35 bronze badges2 Answers
Reset to default 8There are a couple of different approaches to your issue:
Use Programmatic creation of dijit widgets. instead of specifying dojoType on elements, you can create and place the widgets through javascript programmatically. In the dojo reference docs, you'll notice most ponents have a declarative example and a programmatic example (for example, dijit.form.Select). The programmatic style allows you to avoid placing dijit ponents directly in your html markup.
Also, Dojo 1.6 offers a new style of placing attributes on declarative ponents. Rather than specifying dojoType, you can use data-dojo-type. More information on this new feature can be found here.
You can solve the parseOnLoad issue a couple of ways. One way is hiding the page content until the parsing has pleted. The dijit theme tester does this. You'll notice when you load the page you will initially see a message about the page loading, then the fully populated page will fade in.
To have valid HTML, from Dojo 1.6 onwards you can use data-dojo-XXX
attributes instead of the dojoXXX
ones. The HTML5 spec reserves the "data-" prefix for this sort of user-defined attribute.
http://dojotoolkit/features/1.6/html5data-attributes
本文标签: javascriptdojoType alternativeStack Overflow
版权声明:本文标题:javascript - dojoType alternative - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744554975a2612416.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论