PDA

View Full Version : TreePanel Collapse Problem



TonBR
4 Aug 2011, 12:04 PM
Hi...
I have an application with 2 TreePanels, where I drag items between.
The nodes are loaded dinamically with an ASP.NET C# handler in JSon format.
The problem is after nodes are loaded, when I collapse any node, the childs nodes are hides normally, but the node immediately bellow, returns to expanded location and the space between both stays empty.
How I do to correct this problem? In other project, I have the same code and files structure and works correctly.

Bellow is my code:



var Tree = Ext.tree;
var treeDisp = new Tree.TreePanel({
animate: true,
autoScroll: false,
loader: new Tree.TreeLoader({dataUrl: 'acessos.ashx?q=' + perfil + '&t=1'}),
enableDD: true,
containerScroll: true,
border: false,
rootVisible: true,
width: '100%',
height: '100%',
dropConfig: {
appendOnly: true,
onNodeDrop: function (nodeData, ddSource, e, data ) {
PageMethods.setAcesso(perfil, data.node.id, 'D');
rootSel.reload( function() {
rootSel.expand(true, false);
});
rootDisp.reload(function() {
rootDisp.expand(true, false);
});
}
}
});
new Tree.TreeSorter(treeDisp, {folderSort: true});
var rootDisp = new Tree.AsyncTreeNode({
text: 'Arraste aqui',
draggable: false,
id: 'modulos'
});
treeDisp.setRootNode(rootDisp);
treeDisp.render('divTreeDisp');
rootDisp.expand(false, true);