Login Register

How do I get a ref to a store I declaratively instantiated??? byJsId, byId, byFunction, byMagic???

jsId creates global reference

It's easier than you expected: just paletteStore, no functions required.

it attaches the store to the global ref defined by the attribute. jsId = "conuntryStore" means the dojo.data store is available as countryStore.fetch()/etc

jsId attribute explained on the parser page.

though for a second i was

though for a second i was seriously considering writing a dojo.byMagic() function. sounds useful :)

thanks dante :)

thanks dante. haha yah dojo.byMagic() would be a handy function to have :)

There's getObject

There's enough magic in dojo.getObject alone... :)

dojo.byMagic = dojo.getObject;
dojo.byMagic('paletteStore');

/* GeSHi (C) 2004 - 2007

dojo.byMagic = dojo.query;
dojo.extend(dojo.query,{
// add all the magic you want
   
});
dojo.byMagic(".links").connect("onclick",function(e){ dojo.stopEvent(e); });