Moving columns remove cell meta

Tags: #<Tag:0x00007f8b2b0a2ec8>

I need to set some custom data to a cell and saw this solution with the use of setCellMeta.

My tables usually have column sorting and moving columns enabled. The custom cell data did remain intact when sorting however it seems to have been lost when I re-order columns.

Please take a look at this fiddle.


Edit

I was just checking every other cell in the table and it seems the custom data wasn’t really “lost” per se, more like misplaced… after moving the column a few steps forward, the custom data was located on the correct row but on the wrong (previous) cell.

True, cellMeta does not follow the CRUD operations. By using hooks like afterCreateRow, afterRemoveRow you can move the meta accordingly. But since it’s a common use case we’re working on making this a default behavior: https://github.com/handsontable/handsontable/issues/6274 I think that the PR https://github.com/handsontable/handsontable/pull/6254 should already have this implemented. Please follow those issues for progress.

1 Like