This is a migrated thread and some comments may be shown as answers.

Programatically Trigger seriesClick

4 Answers 92 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Collin
Top achievements
Rank 1
Collin asked on 01 May 2014, 02:12 PM
Is there a way to programatically trigger the click event on a chart series?  I'm trying to setup a unit test to test the seriesClick function and haven't been able to see anything.  In a somewhat desperate attempt I tried to trigger the click event on everything to see if I got something to trigger the event but it appeared as though nothing hit it; I have some console output as soon as the function runs. I used this line of code to try to execute the event.

$('*').each(function(){
    $(this).click();
});

4 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 05 May 2014, 11:04 AM
Hello,

The chart uses the mousedown and mouseup events instead of click. The event can triggered on a particular element as in the snippet below:
element.mousedown().mouseup();


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Collin
Top achievements
Rank 1
answered on 05 May 2014, 02:56 PM
Thank you for that however it appears as though IE 10 and 11 don't support this..or aren't responding to it as kendo is expecting?
0
Accepted
Daniel
Telerik team
answered on 07 May 2014, 12:08 PM
Hello again,

Internet Explorer 10 and 11 use pointer events - in IE 10 "MSPointerDown" and "MSPointerUp":
element.trigger(jQuery.Event("MSPointerDown", { originalEvent: {} }))
    .trigger(jQuery.Event("MSPointerUp", { originalEvent: {} }));
and in IE 11 "pointerdown" and "pointerup":
element.trigger(jQuery.Event("pointerdown", { originalEvent: {} }))
    .trigger(jQuery.Event("pointerup", { originalEvent: {} }));


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Collin
Top achievements
Rank 1
answered on 09 May 2014, 01:23 PM
This worked and fortunately it doesn't trigger the events for Chrome, firefox and IE9. Thanks a bunch!
Tags
Charts
Asked by
Collin
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Collin
Top achievements
Rank 1
Share this question
or