Hi and thanks for all your help; but you still dont fully understand my
issue :)

I only have a reference to the DOM element I want to find a child on. In
practice, that element may not have any ID...
So a query like "#myElement > .MyTargetClass" is not possible, because the
base element has not any ID (I gave it one on the examples to try to make it
clearer, but it probably confused you instead). As I said, I only have a
reference to the DOM element, not its id nor class (it may not have any).

So how would you do that? I think it's not possible currently so I'd like to
raise a feature request.

Jean-Noel


On Wed, Jun 24, 2009 at 9:10 AM, Alexander Back <[email protected]>wrote:

> 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
>
------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to