called when the user has requested to expand the node
Usage
function (node) (view source)
if(!node.isExpandable){return;
}var model = this.model,
item = node.item;
switch(node.state){case"LOADING":
// ignore clicks while we are in the process of loading datareturn;
case"UNCHECKED":
// need to load all the children, and then expand
node.markProcessing();
var _this = this;
model.getChildren(item, function(items){
node.unmarkProcessing();
node.setChildItems(items);
_this._expandNode(node);
},
function(err){
console.error(_this, ": error loading root children: ", err);
});
break;
default:
// data is already loaded; just proceed
node.expand();
if(this.persist&&item){this._openedItemIds[model.getIdentity(item)] = true;
this._saveState();
}}