PDA

View Full Version : Dont work DD to node



andrew79rus
18 Aug 2009, 8:32 AM
Hello.

I transfer the interface containing TreePanel from the version 2.?.? on version 3 and have faced a problem.



var nodes = [{'text': 'node 1',
'id':'node_1',
'expanded':false,
'allowDelete':true,
'draggable':true,
'leaf':true,
'children': null
},{'text': 'node 2',
'id':'node_2',
'expanded':false,
'allowDelete':true,
'draggable':true,
'leaf':false,
'children': [{'text': 'node 1 includ',
'id':'node_1_in',
'expanded':false,
'allowDelete':true,
'draggable':true,
'leaf':true,
'children': null,
},{'text': 'node 2 includ',
'id':'node_2_in',
'expanded':false,
'allowDelete':true,
'draggable':true,
'leaf':true,
'children': null,
}]
},{'text': 'node 3',
'id':'node_3',
'expanded':false,
'allowDelete':true,
'draggable':true,
'children': null,
'leaf':true
}];

var tree = new Ext.tree.TreePanel({
useArrows: false,
autoScroll: true,
animate: true,
enableDD: true,
containerScroll: true,
border: false,
titleCollapse: false,
id_div: divid,
// auto create TreeLoader
//dataUrl: 'get-nodes.php',
root: new Ext.tree.AsyncTreeNode({
expanded: true,
draggable:false,
text: 'Main',
id: 'index',
children: nodes
})
});

tree.addListener('movenode', function(tree, node, oldParent, newParent, index){
var params = { node : node.id, oldParent : oldParent.id, newParent : newParent.id, index: index};
//my function
}, this);


tree.render('tree');
At use Drag&Drop I cannot transfer node on other node which does not have descendants (leaf is true).



In old ExtJs it worked without additional options.

Somebody knows what to do?

andrew79rus
19 Aug 2009, 11:06 AM
Really nobody faced such problem?