PDA

View Full Version : Somthing going wrong after appendChil() is executed



zzhouag
25 Apr 2013, 8:30 PM
The code:


...
console.log('before appendChild: ')
console.log(node.data);
console.log(node.data.tablerow);

var newChild = node.appendChild(node.get('tablerow'));

console.log('after appendChild: ')
console.log(node.data);
console.log(node.data.tablerow);
...


the log as below, I want to append "tablerow" to parentNode, before appendChild(), everything is Ok. But after appendChild(), I don't know why I can't get "tablerow" although I still can see "tablerow" in node.data. Is it the "tablerow" change to other data type after appendChild()? Please help! Thank you!43362

slemmon
29 Apr 2013, 11:13 AM
I'm not sure I follow, yet.
It looks like from your console that it grabbed a reference to the tree node both times, no?

zzhouag
29 Apr 2013, 9:46 PM
Sorry, I mean the last row record of console should be the same as second row record, but they are different before and after appendChild() is executed. I need to reuse this record to append again, but after the first appending, it contains nothing just an empty folder, I illustrate the issue with some pictures in the link below,

http://www.sencha.com/forum/showthread.php?262242-TreeNode-type-changed-after-appendChild(node)

Thank you!

slemmon
7 May 2013, 10:01 AM
Any chance you can post a code snippet of what you're doing now (in [ ] code brackets, not a screenshot)?