[#6426] Unable to Show Last Column After Hiding

Tags: #<Tag:0x00007fd2cabbba80> #<Tag:0x00007fd2cabbb5f8>

When the backing data has more columns than handsontable, I am unable to show the last column.
I’ve created a basic jfiddle here:
http://jsfiddle.net/abmk829z/2/

Hey Bryan,

columns settings that you use always represent the set of columns. If you define only two objects in the columns array you will get only 2 columns.

Try removing

columns: [{
      data: 'A'
    },
    {
      data: 'B'
    }
  ]

Aleksandra,

Thank you for your response. For my use case, the user should only be able to view specific fields in data() and I need to set custom renderers and editors on the fields that I am displaying

You still can add column while using the above structure, but you need to manipulate the array defined in columns. It can be done by calling updateSettings.

Aleksandra,

I’ve updated my example here: http://jsfiddle.net/r8aypd0u/

I have three fields in ‘data’, but I only want two of them displayed in the table, so I used the columns to only display the two fields. The problem occurs when I try to hide columns.
If I try to hide column ‘B’, I am unable to show it again.

Hey Bryan,

hiding has to be done via hiddenColumns plugin to be available in the default dropdown/context menu. If you want to use columns instead you’d need to create a custom option for the context menu.

Aleksandra,

I am using the hiddenColumns plugin. It works for column A, but not for column B.
If you look at the second screenshot, the “Show column” option does not display even though column B was hidden using the hiddenColumns plugin.

Thank you for sharing the description. It looks like we do not have this issue reported on Github so I’ve posted it here https://github.com/handsontable/handsontable/issues/6426 and will update you as soon as we get this done.