hi
// Events from data store
_requeryTop: function(){
// reruns the query for the children of the root node,
// sending out an onSet notification if those children have changed
var _this = this,
oldChildren = this.root.children;
this.store.fetch({
query: this.query,
onComplete: function(newChildren){
_this.root.children = newChildren;
// If the list of children or the order of children has changed...
if(oldChildren.length != newChildren.length ||
dojo.some(oldChildren, function(item, idx){ return newChildren[idx] != item;})){
_this.onChildrenChange(_this.root, newChildren);
}
}
});
},
_requeryTop: function(){
// reruns the query for the children of the root node,
// sending out an onSet notification if those children have changed
var _this = this,
oldChildren = this.root.children;
this.store.fetch({
query: this.query,
onComplete: function(newChildren){
_this.root.children = newChildren;
// If the list of children or the order of children has changed...
if(oldChildren.length != newChildren.length ||
dojo.some(oldChildren, function(item, idx){ return newChildren[idx] != item;})){
_this.onChildrenChange(_this.root, newChildren);
}
}
});
},
var _this = this,
oldChildren = this.root.children;
is this line correct ??
dino

fine?
I think it's fine, since this == _this they can be used interchangeably. The purpose of _this is to be accessed inside the closure (ie, the function). Inside the function this points to the global window object or something... actually probably the best thing to use is the scope argument to store.fetch() but I didn't know about that parameter when I wrote this code.
=========
Bill Keese
Project Lead (aka BDFL) of Dijit