Skip to content

Instantly share code, notes, and snippets.

@dmachi
Created January 5, 2011 03:49
Show Gist options
  • Save dmachi/765903 to your computer and use it in GitHub Desktop.
Save dmachi/765903 to your computer and use it in GitHub Desktop.
example using deep resolution
return dojo.when(app.persevere.getStore("Project"),
function(store){
return dojo.when(store.get(data,{resolve: [["triggers"],["destination"],["jobs"]]}),
function(data){
var triggers=[];
var queues=[];
var activity=[];
if(!data|| !data.triggers){
return;
}
console.log("here4");
dojo.forEach(data.triggers, function(trigger){
console.log('here 5');
var q = trigger.destination;
triggers.push("<div><h3>"+trigger.name+"</h3></div>");
queues.push("<div><h3>"+q.id+"</h3></div>");
dojo.forEach(q.jobs, function(job){
activity.push("<div><h3>"+job.id+"</h3></div>");
},_self);
},_self);
_self.triggerListNode.innerHTML=triggers.join('');
_self.queueListNode.innerHTML=queues.join('');
_self.activityListNode.innerHTML=activity.join('');
console.log("resolved object: ", data);
return data;
}
)
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment