最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - dojo query on widgets - Stack Overflow

programmeradmin3浏览0评论

Can the dojo.query function be used to lookup widgets with certain attributes?

for instance, if I want to get a list of all input widgets with type hidden. It seems to me that dojo.query only works for DOM objects and is not meant to be used with objects. Is this correct?

For instance dojo.query('input[type=hidden]') would normally work for regular HTML input fields but does not work for Dojo ones especially that they tend to be wrapped in DIVs, etc.

Thanks

Can the dojo.query function be used to lookup widgets with certain attributes?

for instance, if I want to get a list of all input widgets with type hidden. It seems to me that dojo.query only works for DOM objects and is not meant to be used with objects. Is this correct?

For instance dojo.query('input[type=hidden]') would normally work for regular HTML input fields but does not work for Dojo ones especially that they tend to be wrapped in DIVs, etc.

Thanks

Share Improve this question edited Nov 16, 2011 at 16:04 Ayyoudy asked Nov 16, 2011 at 15:24 AyyoudyAyyoudy 3,72112 gold badges49 silver badges66 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

You're right. For dijit, use dijit.registry to lookup the widgets in your page : http://dojotoolkit/reference-guide/dijit/registry.html

You can also specify nodes for dojo.query to search on.

I.E.

dojo.query('input[type=hidden]', widgetObject.domNode);

this may help, just throwing it out there

发布评论

评论列表(0)

  1. 暂无评论