I think I've narrowed it down to the _createChildrenNodes, which needs to be modified so that children of children are appended to the parent layer node array and are updated when _adjustToState is called. However, I'm having some trouble following this bit of code, could you provide any suggestions nliu? _createChildrenNodes: function (a, b) {
this.rootLayerTOC._currentIndent++;
for (var d = [], c = 0, e = a.length; c < e; c++) {
var g = a,
f = {
rootLayerTOC: this.rootLayerTOC,
rootLayer: this.rootLayer,
layer: this.layer,
legend: this.legend
};
f = g;
f.data = g;
g = new agsjs.dijit._TOCNode(f);
g.placeAt(this.containerNode);
d.push(g)
}
this._childTOCNodes = d;
this.rootLayerTOC._currentIndent--
}