开发者

To use dojo widgets or html?

I am new to web design. Currently I am using Dojo for client side development including UI. One question that has struck me recently (after reading answer to one of my previous questions) is whether there is any advantage in using Dojo f开发者_运维知识库or creation of simple widgets which are available in HTML (table,select,button).

Any suggestions will be appreciated.


If you check the Dijit reference you will find that most widgets that are similar to the HTML ones all have some extra features. For example, the form widgets all play well with the validation stuff and some have a more sane API than the original one.

As per your previous question, Layout widgets are kind of the odd duck. Layout is at a core a HTML thing that you can usually achieve without needing Javascript. The Layout widgets out there are usually for the tricky stuff, likethe the BorderContainer (plain CSS doesn't allow you to have the lower pane fill the rest of the screen when you have an unknown side header pane - the height needs to be set by hand via JS)


The main advantage of widgets is allowing you to package all the HTML and JS you create into a single, reuseable, packet. Widgets also allow for a convenient OO programming style and help you decouple your functionality from the DOM . For example, when you create your widget you can make it have direct access to the appropriate DOM nodes via its object properties, freeing you from having to add ids and classes to your HTML just to guide your Javascript functionality.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜