extjs3 - TreePanel not expanding ExtJS 3 -
this code -
var mytree = { containerscroll: "true", width: 500, root: new ext.tree.asynctreenode({ id: "source", text: "root", expanded: true, draggable: true, expandable: true }), loader: new ext.tree.treeloader({ dataurl: 'page.php?action=get_tree', preloadchildren: true, expandall: function () {} }), xtype: "treepanel", loadmask: { msg: 'loading...' }, maskdisabled: false, id: "tree", listeners: { click: function (node, event) { // render entity data in right panel handleaction(node); } } }
when user clicks on node of tree, fetch data db , rendering panel using handleaction
method. in case, need show node's info in panel , update it. on update handler, need change node's text/id updated now.
this works fine need refresh tree that, can view updated node. but, doesn't work me :(.
this code updating node -
var tree = ext.getcmp('tree'); var id = req.responsetext.split('#')[1]; var myid = 'spec#' + entityid; var node = tree.getnodebyid(myid); node.id = 'spec#' + id; node.text = updated_spec_id; tree.enable(); tree.getloader().dataurl = 'page.php?todo=get_tree'; tree.getloader().load(tree.root); // have tried not succeed. tree.getview().refresh(); tree.expandall(); node.expand(); tree.getrootnode().expand(true);
however, when manually expand using mouse click, node updated.
please help. in advance.
have tried dolayout
function? excerpt doc:
if container rendered when add called, may need call dolayout refresh view causes unrendered child components rendered. required can add multiple child components if needed while refreshing layout once.
it seems me, tree doing normal behaviour. because, had used click
event, therefore event fire when click node.
Comments
Post a Comment