I think I have a similar problem to the one listed above. Both my TreeView and ContextMenu exist in the same update panel. My TreeView nodes are set to PostBack on Select. Here is what happens:
Page Loads - all is fine, right click pulls up context menu on nodes, I can expand and collapse (expand on select is FALSE). When I select a node (a subsequently postback) the context menu stops functioning.
I think this is similar behaviour to the poster above. I don't want to hijack his question but perhaps the answer will suit both of us.
Thanks,
Matt.
function HandleContextMenuPopup(sender, node, event)
{
var nodeContextMenuID = node.getContextMenuID();
if (node.getContextMenuID().length == 0) return;
var expandEnabled = node.getChildNodes().length > 0 && !node.getExpanded();
var collapseEnabled = node.getChildNodes().length > 0 && node.getExpanded();
var contextMenu = CFlyContextMenu.getInstanceById(\"\");
var items = contextMenu.getItems();
var nodeDepth = node.getLevel();
Just enabled/disables items based on the node on right-click.
}
function ExpandNode(item, argument)
{
var node = argument;
node.expand();
}
function CollapseNode(item, argument)
{
var node = argument;
node.collapse();
}
function DeleteNode(item, argument)
{
var node = argument;
if (confirm(\"Are you sure want to delete node \" + node.getValue()))
node.remove();
}