Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ritchie Masterson on Jul 18, 2009 14:50
open dhtmlx forum
dhxFolders contextmenu

Hey Guys,
I am trying to add a context menu to the dhxFolders object. I didn't find any samples for doing it but assumed it was the same setup as for the dhxGrid. When I run it, the menu does appear but it gets overlapped by the default browser context menu on right click.

Do you have sample code that I can compare?

Rgds,
Ritchie.
Answer posted by Alex (support) on Jul 20, 2009 02:35

Hello, 

Folders don't support conent menu. But you can can try to use the following approach to add dhtmlxmenu as a context menu:

menu = new dhtmlXMenuObject(null,"standard");
menu.setImagePath("codebase/imgs/");
menu.renderAsContextMenu();
...
myFolders = new dhtmlxFolders("folders_container");
...
document.getElementById("folders_container").oncontextmenu = function(e){
  var ev =(e||event); 
  ev.cancelBubble = true;
  menu.showContextMenu(ev.clientX,ev.clientY)
  return false;
};
menu.attachEvent("onClick", function(id){
var folderId = folder.contextID;
...
}