khan4019 / tree-grid-directive

Need one or more maintainer for this! comment or email me if you are interested
http://khan4019.github.io/tree-grid-directive/test/treeGrid.html
347 stars 183 forks source link

Array assignment #60

Closed storrisi closed 8 years ago

storrisi commented 9 years ago

I noticed a wrong assignment in the example you posted, in the getTree() function, which cause that the array passed to the getTree() function got modified after the assignment.

You should correct

item = data[0]

with

item = data.slice(0,1)[0],

and

item = data[i++];

with

var z = i++; item = data.slice(z,z+1)[0];