In Handsontable, it is possible to get data object via getData function. I also need to save metadata of Handsontable instance e.g. actual column sizes, merged cells etc. Is it possible to get one object which describes actual state of table and use it to save and load state along with data ?
Using a custom renderer you could build this object each time the table gets rendered (which happens quite often). What I would do is create this global object, call it metaData
, with the keys you need (columnSizes
, mergedCells
, etc), and as the renderer goes through, store this data. What I mean by "as the renderer goes through" is that the custom renderer, if set for each column, will get called for each cell, or td
tag. What you'd then do is use the information given which includes this tag, row/col indeces, values, instance, etc.
I say use the custom rendering because the sort of meta data you mention seems to all be related to the rendering and not the actual data. Would this work for you? It's the best way I can think of doing this.