Context Menu

Here’s a pretty simple one. I’m having a problem new to version 1.5, where context menus instantly move from their correct place to the upper left hand corner of the page.



An easy way to see this happen is to change the “pro_menu.html” file in the sample directory.



Simply alter the function “ChangeMenu(itemId)” from this:





function ChangeMenu(itemId){

if (tree.hasChildren(itemId) > 0){

aMenu.menu.hideButtons(‘outher’);

} else {

aMenu.menu.showButtons(‘outher’);

}

//tree.selectItem(itemId,true);

}





To this:



function ChangeMenu(itemId){

aMenu.menu.loadXML(“menu/context.xml");

}



Yes, you’ll get duplicate menu items, I’m not concerned with that as I’ve got functions to fix that. What does concern me of course, is that the positioning is wrong. Is there anyway for me to use the loadXML function in the setOnShowMenuHandler event without having the context menu show up in the wrong place? Or is this a bug you need to address (this didn’t happen in version 1.4)?



Thanks,

Randy



ps. Here’s the whole piece of html code so you don’t have to make the changes yourself:













    DHTML Tree samples. dhtmlXTree Pro - Context menu





    body {font-size:12px; }

    .{font-family:arial;font-size:12px}

    h1 {cursor:hand;font-size:16px;margin-left:10px;line-height:10px}

    xmp {color:green;font-size:12px;margin:0px;font-family:courier;background-color:#e6e6fa;padding:2px}





    

Context menu



    

    

    

    

    

    

    

    

Right click on tree node