[GH #5845] Afterchange weird behaviour with hidden columns

Tags: #<Tag:0x00007f8b28c5b358> #<Tag:0x00007f8b28c5b218>

Hi,

I have hidden columns in my table.in between the visible rows. Col 1 is visible, then 2-4 is hidden, 5 is visible, 6-10 is hidden, 11 is visible and so on.
Now if i copy data from col 1 and paste is to the visible columns 5 and column 11, the afterchange event returns a larger array in the changes[] parameter. changes[] should only include 2 elements. In fact the beforePaste and afterPaste is giving the actual result, i can see only the changed cells in these hooks.

You may find the discrepancy in the changes[] array in afterchange hook.


Appreciate your help… thank you…

PS: when hidden columns are off, the changes[] array in afterchange hook looks proper. Facing the same issue with drag-down as well when hidden rows are on,

Hi Aleksandra, could you figure out this behavior?

Also, which hook can be used for the drag start and drag end event? As a workaround, i would like to disable drag in this scenario (only in this scenario… i cannot disable drag in the entire table, it is a key feature)

Thank you…

Hey @prasanth.sivakumar

sorry for keeping you waiting. I haven’t found an easy way to exclude the second column. Maybe it would be possible via beforePaste. Have you tried it?

Yes, i get the changes cells properly with beforePaste hook. However i face the same issue in grad-down as well. Which hook should i use to handle the problem in drag-down?

Thank you…

You can try the https://handsontable.com/docs/6.2.2/Hooks.html#event:beforeAutofill hook.

Please keep me updated about the progress.

Ah, my bad… not sure how i missed this in the documentation… sorry Aleksandra…

let me try and keep you posted.,.,

OK :slight_smile: I keep my fingers crossed

Aleksandra, will keep you posted… However, the question of why the changes[] do not give the proper value in afterchange hook remains a mystery (refer the screenshots in my first post)

It has to be related to the fact that the columns are still available for some plugins even when they do not appear in the table.

But what is weird is that the columns showing up in changes[] are not proper… If my selection spans the hidden columns, even if changes[] have all the columns including the hidden ones within the drag span, it is fine. But as you can see in the screenshot in my initial post, changes[] have no correlation to the changes column index.

Hey @prasanth.sivakumar

I was wondering with our developer if you are actually looking for the behavior of skipColumnOnPaste? Here’s a demo that you can test https://jsfiddle.net/u5h0xtL3/

Andrea, does the same apply to drag-down as well? or only to paste?

The skipColumnOnPaste is only for paste operation.

Thanks Aleksandra, facing the same issue with drag-down as well… any suggestions?

You can try https://handsontable.com/docs/7.0.0/Hooks.html#event:beforeAutofill or https://handsontable.com/docs/7.0.0/Hooks.html#event:beforeAutofillInsidePopulate but I have never tried tried it. It is more a workaroud.

Sure, would you like to log this as a defect?

I would rather call it a feature as while creating the hiddenRows we did not mention that they will not take part in the autoFill process. I have added it to our Github board https://github.com/handsontable/handsontable/issues/5845