Tree display not updating when adding first node to expanded node
hi
please have @ following code. reproduce faulty behaviour have expand item, click "add" button , observe, nothing happens. collapsing, expanding node shows added children. use flex 3.5.0
is bug in sdk or missing auto update switch?
thanks!!
<?xml version="1.0" encoding="utf-8"?> <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" minwidth="955" minheight="600" creationcomplete="run()"> <mx:tree id="tree" width="300" height="500" labelfield="name" /> <mx:button label="add" click="onclickadd()" /> <mx:script> <![cdata[ import mx.collections.arraycollection; import mx.utils.objectproxy; protected var itm1:object; protected function run() : void { var ac:arraycollection = new arraycollection(); this.itm1 = new objectproxy({name:"1", children:new arraycollection()}); ac.additem(this.itm1); this.tree.dataprovider = ac; } protected function onclickadd() : void { this.itm1.children.additem({name:"child"}); } ]]> </mx:script> </mx:application>
hi,
it work if collapse , expand node programmatically after adding child. there has better way.
protected function onclickadd() : void
{
this.itm1.children.additem({name:'child'});
if(tree.isitemopen(itm1))
{
tree.expanditem(itm1,false);
tree.expanditem(itm1,true);
}
}
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment