Welcome Guest Search | Active Topics |

detect right click in dataPointMouseDown event
danarj
#1 Posted : Tuesday, December 3, 2013 7:52:26 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/3/2013(UTC)
Posts: 1

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
hello
I am developing a drill-down chart and I want to check if right or left mouse button has been clicked on the chart?
Dragan
#2 Posted : Tuesday, December 3, 2013 8:43:54 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
Currently you can't detect if it is right click or not in the 'dataPointMouseDown' event (we should change this), but you can use this code as workaround:

Code:
  var context;

            $('#jqChart').bind('mousedown', function (e, data) {

                if (!context) {
                    return;
                }

                var right = e.which === 3;

                if (right) {
                    context = null;

                    var x = context.x;
                    var y = context.y;
                    // do something
                }
            });

            $('#jqChart').bind('dataPointMouseDown', function (e, data) {

                context = data;
            });

            $('#jqChart').bind("contextmenu", function (e) {
                // don't show context menu
                return false;
            });
Best Regards,
Dragan Matek
jqChart Inc.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.069 seconds.