canvas-datagrid
canvas-datagrid copied to clipboard
fitColumnToValues without value crash
Expected behavior and actual behavior.
When calling fitColumnToValues()
without value, all columns should be refitted to data as described in documentation. Datagrid instead crashes on
Uncaught TypeError: Cannot read property 'index' of undefined
at HTMLElement.e.fitColumnToValues (canvas-datagrid.js:1)
at switchSheet ((index):242)
Upon checking source code, there is really no mechanism for fitting all columns: https://github.com/TonyGermaneri/canvas-datagrid/blob/master/lib/publicMethods.js#L602
Steps to reproduce the problem.
Call fitColumnToValues()
without value
Specifications like the version of the project, operating system, or hardware.
Version: latest.
oh no! That's terrible.
In the meantime you can use this:
grid.schema.forEach(function (c) { grid.fitColumnToValues(c.name); });
It will do the same thing.
I'll get this error patched up.
Sweet, thanks! 👍