[GH #5661] Update setting: add comments

Tags: #<Tag:0x00007efc6527a458> #<Tag:0x00007efc6527a250>

In my opinion I found another bug when adding comments through updateSettings. If both sorting and filter are activated, comments are not added correctly, and if rest, it works well. I use the toVisualRow method. For example, you can try, first sort and apply the filter, then click the addComment button.

https://jsfiddle.net/ow80sbvm/4/

Hi @pontiac358

I can imagine that you’d like to show ‘2020’ for a cell with the same value. The same time you want to hide the cell with its comment when it is filtered out. I am right? Currently, you are adding comments to some visual rows, while most of them can be filtered out and the result becomes null.

Yes you are right. I have comments that I add after the filter and sort, how do I get its right indexes

You’d need to show a comment that depends on a value. You can use a getDataAtCell method

No, that will not do :slight_smile:
I initially add the data and comments so {data:[ [9, 10, 11, 12, 13, 15, 16]...], cell:[{row: 1, col: 0, comment: {value: '2017'}}...]}
Because of this bug [GH #5661] Why comments are deleted after updating columns?, I have to re-add comments.
But if the filter and sorting is turned on, I cannot add them to the right places.

toVisualRow it helps if only sorting or filter is enabled, but if both sorting and filter are enabled, it returns the wrong index.

I will ask our CTO to schedule the https://github.com/handsontable/handsontable/issues/5661 for as quick as possible.