DHTMLXScheduler 2.3 onContextMenu Event

Hi,

I am trying to capture the RIghtCick (onContextMenu) Event of the Scheduler with this code.

    // Trap Event for Context Menu
    scheduler.attachEvent("onRightClick",
        function (event_id, native_event_object)
        {
            alert('1');
            native_event_object.cancelBubble=true;
            native_event_object.returnValue = false;
            if (native_event_object.stopPropagation)
                native_event_object.stopPropagation();

            setSelectedEventId(event_id);
            mainScheduleContainer.fireEvent("OnSchedulerContextMenu");

            return true;
        }); 

The Event is trapped and whatever code that as to be fired on OnSchedulerContextMenu gets executed. But I still cant hide the ContextMenu items of the Browser. Am I doing something wrong?

Try to add the next line to the scheduler’s init

dhtmlxEvent(document.getElementById("id of scheduler container", "contextmenu", function(){ return false; })

It must block native context menu for the scheduler’s area in all modern browsers.

Also, as far as I can see scheduler provides onContextMenu event, not onRightClick