PDA

View Full Version : Tree node value



Harikumar.m
20 Jan 2009, 12:29 AM
Hi,

I need to find the node of an selected tree node for droping a row from grid to tree. could anyone tell how i can find node of an tree?

Cheers, B)

Animal
20 Jan 2009, 12:36 AM
Find it by it's ID? Handle a click event, a select event? How can we know what you want?

Harikumar.m
20 Jan 2009, 1:13 AM
var ddtree = new Ext.dd.DropTarget(tree.getEl(), {
ddGroup : 'myGroup',
copy : false,
notifyDrop : function(dd, e, data) {
if(data.grid != null){
var row = data.grid;
var select = data.selections;
var destination;
destination = Node id which i need to get ;

for (var i=0; i<select.length; i++) {
addRowToTree(destination, row);//this passes the node id and row of grid as parameters to insert a row in tree.
}
this.cancelExpand();
this.removeDropIndicators(this.lastOverNode);
return true;
}}
});

Now i am stuck up in finding the node id of the selected node.

Animal
20 Jan 2009, 1:26 AM
Format your code, and I'll read it.

Harikumar.m
20 Jan 2009, 1:34 AM
var dropToTree = new Ext.dd.DropTarget(tree.getEl(), {
ddGroup : 'a',
copy : false,
notifyDrop : function(source, e, data) {
if (data.grid != null) {
var row = data.grid;
var select = data.selections;
var destination;
//console.log(this);
destination = //Node value which i need to call a function
for (var i = 0; i < select.length; i++) {
addRowToTree(destination, row); // function call to arrange grid row in tree
}
this.cancelExpand();
this.removeDropIndicators(this.lastOverNode);
return true;
}
}
});