Hi I'm trying to build tree type lists where each row in the list has several cells (columns). My code will render the first list ok then stops. The first 'for' statement should be moving to build the second list, but the loop is killed. The 'list', 'row' and 'cell' constructors are not shown.
Any idea what's killing the initial iteration.. is it the recursion in getChildren()?
Thanks for you help!
Any idea what's killing the initial iteration.. is it the recursion in getChildren()?
Thanks for you help!
Code:
function getlist() { this.list = arguments[0].split(","); this.render = function() { document.getElementById('workspace').innerHTML=""; for(x in this.list) { var listid = this.list[x]; var rootid = list[listid].root; document.getElementById('workspace').innerHTML += list[listid].html; list[listid].resize(); resize('workspace', 'list.'+listid); document.getElementById('list.'+listid).innerHTML += row[rootid].html;//render the root's html getcells(rootid, 'row.'+rootid); getChildren(rootid); } } } function getChildren(rowid) { for(n in row[rowid].children) { var child = row[rowid].children[n]; document.getElementById('children.'+rowid).innerHTML += row[child].html;//add the child row html the the child container getcells(child, 'row.'+child); getChildren(child);//then get the child row's children } } function getcells(rowid, target) { for(y in row[rowid].cell) { var cellid = row[rowid].cell[y]; document.getElementById(target).innerHTML += cell[cellid].html;//then add the cells to that child row html } }
Comment