Handsontable problem: Can’t change data once nestedRows=true

Viewed 24

I'm working with the Handsontable nested rows. I’m trying to set a new dataset for the table with the nestedRows=true but the data remains the same.

import Handsontable from "handsontable";
import 'handsontable/dist/handsontable.full.css';
import "./styles.css";

let data = [
    {a:'', b:'Tesla', c:'Volvo', d:'Toyota', e:'Ford'},
];

const container = document.getElementById('example');
const btn = document.getElementById('btn');
btn.addEventListener("click", doTest);


const hot = new Handsontable(container, {
    data: data,
    width: '100%',
    height: '100%',
    rowHeaders: true,
    colHeaders: true,
    nestedRows: true,
    licenseKey: 'non-commercial-and-evaluation'
});

function doTest(){
    hot.updateData([
        {a:'1', b:'2', c:'3', d:'4', e:'5'},
    ]);
}

Please check the example here

click on “Test” button to update the dataset. For nestedRows=false - works fine, for nestedRows=true - does nothing.

Please help me to understand what is wrong here.

0 Answers
Related