PDA

View Full Version : Events: What am I doing wrong?



jaimalchohan
21 Feb 2009, 2:28 PM
The Move event doesn't appear to fire. What am I doing wrong? Thanks



Ext.onReady(function() {
var Tree = Ext.tree;
Ext.lib.Ajax.defaultPostHeader = 'application/json';
tree = new Tree.TreePanel({
el: 'divMenu',
useArrows: true,
autoScroll: true,
animate: true,
enableDD: true,
containerScroll: true,
dataUrl: 'Services/MenuService.svc/GetNodes',
method: 'POST',
root: {
text: 'Menu',
visible: false,
id: 'source'
}
});

// render the tree and expand the parent node
tree.render();
tree.on('move', DoWork);
tree.getRootNode().expand();
});
function DoWork(a,b,c,d,e) {
var i = node;
}

zoodia
21 Feb 2009, 3:07 PM
The move event should be fired after the actual treePanel is moved. Are you sure this is the event you want?

jaimalchohan
21 Feb 2009, 4:08 PM
But the API says

Move: Fires when a node is moved to a new location in the tree

jaimalchohan
21 Feb 2009, 4:09 PM
Oh, I see what i've done. cheers

zoodia
21 Feb 2009, 4:11 PM
Yeah, for those wondering I think you were looking for the movenode event.

jaimalchohan
21 Feb 2009, 7:34 PM
Yep, I was looking at it, thinking it was a TREE, when in actual fact it's a TREEPANEL