PDA

View Full Version : TreeNodeUI.getIconEl() problem at Tree "append" event



Zerogiven
17 Apr 2010, 4:19 AM
Hi all :)

so i've got another problem this weekend...

I've an append listener at my tree. Inside this event i'll get the node which will be append. But my problem is i don't get the elements of this node (i think this happens cause it's not already rendered at this moment)...

my code

Ext.getCmp("tree").addListener("append", function(tree, parent, node) {
var ui = node.getUI(); // <-- get Object succesfully
debug.trace(ui.getIconEl()); // <-- undefined
});


This is cause i want add a mouseover event to the icon to a node which will append.

So i've ideas but no solution:
.) any possibillity to make an event like "afterappend" or "rendered" to the Node
.) i tried to set a event with Ext.query to the icon... but this works only to the icons which already rendered at the moment i add the listener. Could i make it "live" for all items which will be added into the dom?


Hope you know what i mean/want :D

greetz
Chris

Zerogiven
17 Apr 2010, 5:52 AM
For the mouseover event i found a solution there: http://www.extjs.com/forum/showthread.php?23479-TreeNode-mouseover-event&p=180375

Just the mouseout event fails at the moment (details in the thread above)

greetz
Chris

Zerogiven
17 Apr 2010, 10:12 AM
Got it :)

take a look in the other thread (link above) for my solution... maybe someone can say me there why my solution works, cause i'm not really understanding it ^^

greetz