Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by pl! on Jul 18, 2008 02:31
open dhtmlx forum
Tree with ContextMenu inside iFrame

Hi,

I built a tree inside a DIV container. The container has it's width and height set. Then I attach a context menu to that tree.

When I click on an item inside the tree, the context menu pops up right under the clicked item, everything's fine.

But when I load the whole tree-page in an iFrame and the context menu pops up, it's position is completely wrong. Sometimes it's about 30px ABOVE the clicked item.
Answer posted by Support on Jul 18, 2008 03:14
The context menu has native routines which tries to detect correct position, but in case of complex HTML layout it may fail.
 
You can try
a) disable positioning routines
b) if the shift always is the same you can set the correction manually

var context_menu = new dhtmlXContextMenuObject
context_menu.menu.disableSmartPositioning(true);
context_menu.setContextMenuPosition(correction_x,correction_y);

Answer posted by pl! on Jul 18, 2008 05:16
Works fine now. Your code piece did it, thank you. And thanks for the quick response !