PDA

View Full Version : Update the Text in a context menu item



markus2610
22 Sep 2009, 2:41 PM
I have here two Eventlistener. My problem is with the first click will be the node from treepanel not display, the title from node in the contextmenu, and On the second click it will be show. But the height is scrolling.

this.on({contextmenu:{scope:this, fn:this.onContextMenu, stopEvent:true}});

this.contextMenu.on({

show:{
scope:this, fn:function() {
var node = this.actionNode;
var text = Ext.util.Format.ellipsis(node ? node.text : '', 12);
this.contextMenu.items.item(0).el.update(text);
}}
});

onContextMenu:function(node, e) {
this.actionNode = node;
node.select();
menu.showAt ([e.getXY () [0], e.getXY () [1]]);
e.stopEvent();
}

Thank you for help:-?