Hi Jean-Noel, 

On Monday 22 June 2009 Jean-Noël Rivasseau wrote:
> That's the point, I want to query from the element base, not the whole
> document. 
Then you have to provide the second parameter. This parameter will set the 
root for the query.

> Actually what I want is a bit more complex, I want to return:
> > .FirstClass > .SecondClass
>
> from the element base, that is an element that has the current element as a
> grandfather (and has the class SecondClass, with its parent the class
> FirstClass).
> I cannot really do this with Collection.query, because if I write:
>
> qx.bom.Collection.query(".FirstClass > .SecondClass",myDomElement)[0];
>
> it can return an element that had not the base element as a grandfather...
> All these problems would be solved if the :root syntax was supported I
> guess, but as it is not what should I use ?
If I understand you correctly the second parameter will do the job.

Suppose you have the following DOM fragment (all childs of the body)

--snip--
<div id="myElement">
  <div class="MyTargetClass">
     <div class="MyTargetClass"></div>
  </div>
</div>
<div class="MyTargetClass"></div>
--snip--

The query

qx.bom.Collection.query(".MyTargetClass")

would produce 3 hits and the query

var rootNode = document.getElementById("myElement");
qx.bom.Collection.query(".MyTargetClass", rootNode);

would only produce 2 hits since the query only searches for elements with are 
children of "myElement".

Is that the missing part you searched for?

cheers,
  Alex


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to