PDA

View Full Version : Tree panel problem (maybe a bug)



da_bar
20 Aug 2009, 11:41 PM
Problem is that opening empty folder in a tree recreates a whole tree in that folder, over and over again.

Php code:


<?php

echo '[{"id":"_folder1","text":"Prvi folder","leaf":false,"disabled":true,"allowChildren":false},{"id":"_folder2","text":"Drugi folder","leaf":false,"disabled":false,"children":[{"id":"_unit38","text":"Prvi item","iconCls":"icon_type_car","leaf":true,"checked":false}]},{"id":"allunits","text":"Sve jedinice","leaf":false,"children":[{"id":"1","text":"Drugi item","iconCls":"icon_type_car","leaf":true,"checked":false},{"id":"38","text":"Prvi item","iconCls":"icon_type_car","leaf":true,"checked":false}],"editable":false}]';

?>


ExtJs code:


units_tree = new Ext.tree.TreePanel(
{
loader: new Ext.tree.TreeLoader({
dataUrl: "getTree.php"
}),
useArrows:true,
autoScroll:true,
animate:true,
containerScroll: true,
border: false,
enableDD:true,
root:
{
nodeType: 'async',
text: 'units',
draggable: false,
id: 'all',
expanded: true
}
});


Can someone see if this is a bug or am I doing something wrong?

da_bar
21 Aug 2009, 12:52 AM
I figured it out, if I add 'children': [] as an empty array it works, but it's still a bug as I see it.