Does Dojo have anything like jQuery’s :has() selector?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Dojo, does not support this directly. It has native support for two different selector engines: acme & lite (see documentation for dojo/query). Lite is intended to be fast and efficient but lacking some of the advanced (but rarely used features). Acme is a fully-featured CSS3 selector.
You can also load 3rd-party engines as plugins; including the Sizzle engine used by jQuery. By using Sizzle you then have access to the :has() selector in your queries.
This can be done, either in the main Dojo config or on-the-fly as a plugin:
or:
Since Sizzle is not part of the Dojo core, you will need to download and install it into the sizzle directory next to dojo, dojox, dijit for this to work. (Also, see: dojo/query (alternative selectors) & Sizzle engine).
Unless this is a must-have feature, it’s probably better to use the native selector. However, Dojo is designed with maximum flexibility.