search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Preventing right button of the mouse from selecting a TimeRange

Asked by Jean Pierre SOMDA
8 years ago.

Hi;

Ho to prevent the mouse right button from selecting a TimeRange?..
I only want mouse left button trigger the selecting process.

args.allowed=false doesn't work with the right button selection.

Thank you.

Answer posted by Dan Letecky [DayPilot]
8 years ago.

The following config disables selecting a time range using right mouse button:

dp.timeRangeRightClickHandling = "Disabled";
dp.onGridMouseDown = function(args) {
    var button = DayPilot.Util.mouseButton(args.originalEvent);
    if (button.right) {
        args.action = "None";
    }
};

Note that you will need build 8.2.2222 from the sandbox:

http://javascript.daypilot.org/sandbox/

Earlier builds don't support args.originalEvent property.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.