简体   繁体   English

单击kengo网格行内的kendo图表

[英]Click on kendo chart inside kengo grid row

I have a kendo grid. 我有一个剑道网格。 And one of the columns contains stacked kendo chart one per row. 其中一列包含堆积的剑道图,每行一张。 Here is how I create charts inside the grid using the dataBound event: 这是我使用dataBound事件在网格内创建图表的方法:

self.dataBound = function() {
    $(chartCellSelector).each(function () {

        var $this = $(this);
        $this.kendoChart({
            //chart options go here
        });
    });
};

Then I also how a rowselect grid event. 然后我也如何进行rowselect网格事件。

self.rowSelect = function (e) {
    var dataItem = e.sender.dataItem(this.select());
    //operations with the dataitem
};

When I click on the row outside of the chart control it works fine everywhere. 当我单击图表控件外部的行时,它在任何地方都可以正常工作。 However when I click on the row inside the stacked chart, then sometimes JS error occur: Strangely it occurs only in IE and only on some of the machines: Error: Unable to get property 'removeChild' of undefined or null reference 但是,当我单击堆积图内的行时,有时会出现JS错误:奇怪的是,它仅在IE中且仅在某些计算机上发生:错误:无法获取未定义或空引用的属性'removeChild'

The crash is inside kendo internal javascript libs, so it looks like kendo bug. 崩溃发生在kendo内部javascript库内部,因此它看起来像kendo错误。 I need a workaround for this. 我需要一个解决方法。 Even disabling the click over the stacked chart would be fine, but that is not easy to achieve. 即使禁用对堆积图的单击也可以,但是这不容易实现。 So the question is either how to avoid javascript bug in kendo or how to disable kendo rowselect event over some of the cells(or divs inside the cells)? 因此,问题是如何避免kendo中的JavaScript错误或如何在某些单元格(或单元格内的div)上禁用kendo rowselect事件?

This is a Kendo bug. 这是一个剑道错误。 I've investigated Kendo javascript a bit and the error occurred because of series.highlight property! 我已经研究了Kendo javascript,并且由于series.highlight属性而发生了错误! I simply removed highlights on the configuration like this and the error disappeared. 我只是删除了这样的配置上的亮点,错误消失了。

seriesDefaults: {
                highlight: { visible: false },
                ...
            },

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM