javascript - ExtJS 4.2.1 , Tree, adding children to a node -


i working extjs 4.2.1

i trying append children leaf when click on it. leaf, click transform folder , append leaves children node.

it worked in ext 3.4 seems there problem appendchild() method in 4.2.1. uncaught typeerror: object [object object] has no method 'updateinfo' method due node.updateinfo(commit); can find in appendchild().

this pretty simple instruction:

in ext3

    node.leaf = false;          // add nodes in trees          ( =0 ; < timesheetdata.length ; i++ )          {             // create new node , state it's timesheet              var newnode =  new ext.tree.treenode({                  id : timesheetdata[i].id,                   text : timesheetdata[i].text,                   ts : true }) ;             node.appendchild(newnode);          }      node.expand();  

in ext4

    node.set('leaf', false);          // add nodes in trees          ( =0 ; < timesheetdata.length ; i++ )          {              node.appendchild({                  id : timesheetdata[i].id,                   text : timesheetdata[i].text,                   ts : true });          }      node.expand(); 

ext.tree.treenode doesn't exist anymore in 4.2.1. try append child directly. doesn't work!

what do?

thank you

try in tree listener:

itemclick: function( record, item, index, e, eopts ){             item.appendchild({                 text: 'hi! leaf',                 leaf: true             });            } 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -