handsontable / handsontable

JavaScript data grid with a spreadsheet look & feel. Works with React, Angular, and Vue. Supported by the Handsontable team ⚡
https://handsontable.com
Other
19.08k stars 2.94k forks source link

[Bug]: vue2 insert column disable? #10881

Open zhongguodong opened 1 month ago

zhongguodong commented 1 month ago

Describe the bug

Why is insert column left disabled when I right-click a menu option in Array of objects mode?

Video/Screenshots

image

Provide a link to the demo with the bug reproduction

No response

Handsontable version

14.2

Framework version

No response

Your environment

Chrome,Windows 10

AMBudnik commented 1 month ago

Hi @zhongguodong

When you are using an object-based dataset or/and columns options the column addition is disabled. That option in the menu uses the alter() method underneath.

Zrzut ekranu 2024-03-29 o 08 56 37

To allow users to add a new column, you would need to create you own custom demo option. Here https://handsontable.com/docs/react-data-grid/context-menu/#context-menu-with-a-fully-custom-configuration you can find an example of a custom context menu.

zhongguodong commented 1 month ago

@AMBudnik With an Array of objects, adding columns is prohibited. It needs to be implemented with custom menus and alter methods, is that what you mean?

AMBudnik commented 1 month ago

Yes, that is correct @zhongguodong . Within your custom menu you would need to create an option that is altering the dataset with a new column.

zhongguodong commented 1 month ago

@AMBudnik Array of arrays mode, the menu inside the addition of columns can be. How does this work?

AMBudnik commented 1 month ago

If the dataset is an array of arrays you do not need to create a custom menu - the alter() method will allow you to remove/add columns.