0
votes

I have a page with multiple instances of handsontable. All custom properties of a handsontable seems to be attached to the last rendered table. Is there anyway to get around this?

For Example in the image below while hovering on the top table, comments on the bottom table are shown

enter image description here

Fiddle

code:

$(document).ready(function () {

    function getData() {
        return [
        ["", "Kia", "Nissan", "Toyota", "Honda"], ["2008", 10, 11, 12, 13], ["2009", 20, 11, 14, 13], ["2010", 30, 15, 12, 13]];
    }

    var container1 = document.getElementById('example1');
    var container2 = document.getElementById('example2');
    var options = {
        data: getData(),
        startRows: 5,
        startCols: 5,
        minRows: 5,
        minCols: 5,
        maxRows: 10,
        maxCols: 10,
        rowHeaders: true,
        colHeaders: true,
        minSpareRows: 1,
        contextMenu: true,
        comments: true,
        cell: [{
            row: 1,
            col: 1,
            comment: "Test comment"
        }, {
            row: 2,
            col: 2,
            comment: "Sample"
        }]
    };
    var hot1 = Handsontable(container1, options);
    var hot2 = Handsontable(container2, options);
})
1
That's very strange behavior. Having more than one table seems to be an issue for me as well. But have you tried cloning the options object? Maybe it's copying the reference - ZekeDroid
@ZekeDroid that is not the problem. I tried it jsfiddle.net/yd0fucct/3 - SNAG
I can't find the answer anywhere but I'm meddling with two tables on the same page again, will let you know if I figure something out. I wish there was a bigger community in stack using HOT, not enough fresh ideas yet - ZekeDroid
I actually made my own tooltip framework on top of this because my application can have an arbitrary number of HOT instances. I'll share the code soon - SNAG
oh nice, I had resorted to using the native "Title" attributes on the divs - ZekeDroid

1 Answers

0
votes

This issue has been fixed by the Handsontable team.