【问题标题】:handsontable doesn't work with IE and ChromeHandsontable 不适用于 IE 和 Chrome
【发布时间】:2015-06-21 14:11:31
【问题描述】:

我是 Handsontable 的新手,非常新,抱歉。

我必须修复一个错误,但我不知道该怎么做。

我正在使用以下代码:

$('#tableDiv').on('click', 'td input.htCheckboxRendererInput', function (event) {
    console.log("chosen a row");
    var selection = $("#tableDiv").handsontable('getInstance').getSelected();

    $.each($( this ).closest('td').siblings('td'), function(){
        console.log($(this).text());    
    });
    var indice=$( this ).closest('td').siblings('th').text();
    console.log("indice della riga:"+indice);
    console.log(TABLE_DATA[indice-1]);
    TABLE_DATA_PROMOTE.push(TABLE_DATA[indice-1]);
});

这适用于 Firefox,但不适用于 IE 和 Chrome。

谁能帮我解决这个问题?

【问题讨论】:

  • 添加问题的示例代码,例如添加带有示例代码的 jsfiddle 链接。

标签: jquery cross-browser handsontable


【解决方案1】:

无论是什么问题,我都建议使用events provided by Handsontable。特别是,您正在寻找:

afterSelection (r: Number, c: Number, r2: Number, c2: Number)

选择一个或多个单元格时触发回调(鼠标移动)。参数:

r selection start row
c selection start column
r2 selection end row
c2 selection end column

您可以很容易地看到这可以用来复制您的代码。请注意,如果您一次选择多个单元格,r2c2rc 不同,在您的情况下,我认为这无关紧要。

【讨论】:

    猜你喜欢
    • 2016-08-09
    • 2012-01-27
    • 2012-02-14
    • 2013-07-09
    • 2015-05-07
    • 1970-01-01
    • 2013-04-22
    • 2016-01-29
    • 2015-07-11
    相关资源
    最近更新 更多