我正在使用kendo ui图表,并且当您点击图表/图表的各个条形图时需要触发onclick事件。
我似乎找不到使用jq触发onlcik事件的方法。
这是一个小提琴,
有谁知道如何实现这个目标?
<script>
$("#WastOfTime").click(function(){
alert("Ignore this, could not post a Fiddle without code");
});
</script>
答案 0 :(得分:1)
你可以添加
$("body").on("click", "path", function(e) {
if($(this).data("model-id")) {
alert("Here we go");
}
});
在JS的最后。
修改:添加条件以排除条形图外的点击次数。
示例:here。
答案 1 :(得分:1)
这不是Kendo UI文档。不确定是什么“注意”,但他们有一些点击事件。
$("#chart").kendoChart({
series: [{
data: [{ value: 1, noteText: "a" }]
}],
noteClick: function(e) {
console.log(e.text);
}
});
答案 2 :(得分:0)
This ended up being the solution.
非常感谢!
.bind("seriesClick", function (e) {
console.log("worked");
})