Dojo experts? Selecting table even odd with dojo.query

Associate
Joined
1 Sep 2005
Posts
724
Hi

Anyone here well skilled in dojo?

I am trying to target table styling css for even/odd rows and i am coming up with some issue.

If i run it through stepping the code with firebug it loads the styling but without it does not so it must be some issue with something not loading in time for it to work correctly.

I have had a look at this http://blog.outerthoughts.com/2007/12/dojo-10-highlighting-alternative-table-rows/

but as addOnLoad is depreciated that does not work so i have tried to call dojo/query in the require and my code looks a little like this.

Code:
on(map, "load", function() { 
           dojo.query("#info table tr:nth-child(odd)").addClass("odd"); 
           dojo.query("#info table tr:nth-child(even)").addClass("even");	
           map.disablePan(); 
           map.disableScrollWheelZoom(); 
});

this works when walked through so its something to do with it waiting for the map to load...thats not required to wait for the map as the data gets pulled from a query rest api.

Any ideas, im still learning the new amd style as i would not have had so much issues with the older syntax.

thanks very much
 
Back
Top Bottom