Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by KGriffin on Aug 05, 2008 08:30
open dhtmlx forum
dhtmlXContextMenuObject - Hide

Is there a way to hide a dhtmlXContextMenuObject menu.

We are experiencing a problem with closing a contextMenu when a user clicks inside a dhtmlXGrid.

The contextMenu (thats does not close) is not attched to the dhtmlXGrid, we already have one attached to the grid (which works fine :)

Here is a snippet of what we have tried so far.

//aMenu is a dhtmlXContextMenuObject
setTimeout("timeoutMenu(aMenu)",10000);
aMenu.openAt((Event.pointerX(event)-getXOffset()), (Event.pointerY(event)-getYOffset()), id , true);

function timeoutMenu (m) {
    m.menu.hideBar();
}

Regards,
K Griffin

Answer posted by Support on Aug 05, 2008 09:57

There is no API call for such task, but you can use inner method
                  aMenu._contextEnd();

>>with closing a contextMenu when a user clicks inside a dhtmlXGrid
        grid.attachEvent("onRowSelect",function(){
                  aMenu._contextEnd();
                  return true;
         });