Login Register

dojo.query

dojo.query returned nodeList order

Is the nodeList returned by dojo.query guaranteed to be in document order? I have tried many times and it seems to be, but I would like confirmation.

My use case:
I have a table with rows with different classes. I need to get a list of the rows with class "foo" in document order.

var list = dojo.query(".foo", table);

Thanks
schallm

Simplifying single node query

Here's a bit of a newbee question. How do you target a specific node on a certain level in a nested list hierachy when using dojo.query? So far I've managed to do this with the following code:


function displayControl(n){
var p = n.parentNode;
var pp = n.parentNode.parentNode;

if (n == null || p == null)
return;

//--toggle if any other nodes are open inside the scope of the parent's parent
dojo.query(".navIsOpen", pp)
.toggleClass("navIsOpen")

extending dojo.query to fully support xml

About dojo.query and XML

Apparently dojo.query drops tag names to lowercase which is makes it incompatible with xml documents that are not already in lowercase.

I'm interested in fixing this but there's probably some good reason for this behavior. Could someone outline a good approach for this patch that will not cause regressions against the HTML dom or compromise the performance of the system?

Thanks!

relative position query

Hi,
if in a page there are two element with same id, dojo query with relative position don't work properly.

i.e.

testing dojo.query()

@import "../../resources/dojo.css";

 

dojo.addOnLoad(function() {
                         dojo.query("#b3", "thisForm").forEach(function(n){n.value="X";}); // <--- !!!!
            });

Is there a way to get multiple query items into dojo.query?

I want to select a node that has two classes in it. Like dojo.query(".dndItemOver, .dndItemAnchor") is this possible or is it only one arg? Tried a couple ways and can't find any examples on multiple queries except in stores.

Two dojo.query() Items

  1. A quick tutorial on writing dojo.query() extensions. It's fast, easy, and because we show you how to package it up as a Dojo module, it won't drag down your site performance
  2. The awesomeness that is WebKit just won't quit and we've already added support for the native code path to what will become Dojo 1.1 (look for it in tonight's build). Of course, because the design of Dojo is layered, your dojo.query() extensions work no matter what selector engine Dojo picks as being fastest for a particular search.
Syndicate content