Hi Jean-Noël,

On Tuesday 23 June 2009 Jean-Noël Rivasseau wrote:
> Let me give you a complete example of what I want:
>
> Case 1)
>
> <div id="myElement">
>  <div class="MyTargetClass" id="found">
>     <div class="SomeOtherClass"></div>
>  </div>
> </div>
> <div class="MyTargetClass"></div>
>
> Case 2)
>
> <div id="myElement">
>  <div class="SomeOtherClass">
>     <div class="MyTargetClass" id="notFound"></div>
>  </div>
> </div>
> <div class="MyTargetClass"></div>
>
> -> I want to fetch the *direct* child of myElement if it has a class of
> MyTargetClass.And I get a reference to myElement as a DOM element.
>
> So in case 1, it should return an element (the one with id="found"), but in
> case 2 it should return NOTHING (the element id="notFound" is not a direct
> child).
>
> How would you achieve that in Qooxdoo?
Now I understood your issue. As far as I tested the following selector string 
should do the job:

--snip--
qx.bom.Collection.query("#myElement > .MyTargetClass");
--snip--

The query will return for 1) an element with the id "found" and for 2) 
nothing.

You can also use this

--snip--
qx.bom.Collection.query("#myElement:has(> .MyTargetClass)");
--snip--

This query does return for 1) the element with the id "myElement" and for 2) 
also nothing.

Hope this helps,
  Alex

------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to