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.
[GH #5661] Update setting: add comments
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
No, that will not do
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.