Issue with Grid row height

Grid options object sometimes returns ‘undefined’ value for rows height. To reproduce please run the following snippet, and when the Grid is visible resize the rows’ height with the mouse (first increase it, and then without releasing the mouse decrease it). Check the log. Repeat a few times if needed. Looks like the bug appears when when user switches the resizing direction.

let grid = grok.shell.addTableView(grok.data.demo.randomWalk(100, 100)).grid;

grid.onRowsResized.subscribe((ev) => {
    const options = grid.getOptions();
    const nH =  options.look.rowHeight; //sometimes returns 'undefined'
    console.log("Row Height: " + nH);
});

The issue here is that you are using the serialized representation of settings grid.setOptions. During the serialization, all default values are removed in order to keep the values nice and clean, so it happens that the value 28 (which is default row height) gets removed as well.

We’ve just added the includeDefaultValues parameter to the getOptions method, so you can rewrite your script in the following way:


grid.onRowsResized.subscribe((ev) => {
    const options = grid.getOptions(false);
    const nH =  options.look.rowHeight; //sometimes returns 'undefined'
    console.log("Row Height: " + nH);
});```