Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The -after hooks for creating and removing rows/columns are not well described in the definition file #6296

Closed
AMBudnik opened this issue Sep 27, 2019 · 1 comment

Comments

@AMBudnik
Copy link
Contributor

Description

We are able to set a custom source of change in the alter method

alter(action: 'insert_row' | 'insert_col' | 'remove_row' | 'remove_col', index?: number | Array<[number, number]>, amount?: number, source?: string, keepEmptyRows?: boolean): void;

and works fine, but we do not have this ability defined in the definition file for the -after row/column hooks listed below

      afterCreateCol?: (index: number, amount: number) => void;
      afterCreateRow?: (index: number, amount: number) => void;
      afterRemoveCol?: (index: number, amount: number) => void;
      afterRemoveRow?: (index: number, amount: number) => void;

we also do not mention that the remove- alterations provide the physicalColumns as mentioned in the docs.

Zrzut ekranu 2019-09-27 o 15 11 00

However, all seem to be typed well for the -before hooks

      beforeRemoveCol?: (index: number, amount: number, physicalColumns: number[], source?: ChangeSource) => void;
      beforeRemoveRow?: (index: number, amount: number, physicalColumns: number[], source?: ChangeSource) => void;
      beforeCreateCol?: (index: number, amount: number, source?: ChangeSource) => void | boolean;
      beforeCreateRow?: (index: number, amount: number, source?: ChangeSource) => void;

Steps to reproduce

  1. Look what's return in the console

Demo

http://jsfiddle.net/mr7gw2xj/1/

Zrzut ekranu 2019-09-27 o 15 14 59

Your environment

  • Handsontable version: 7.1.1.
    Not related to any version
  • Browser Name and version: Chrome 77
  • Operating System: macOS Mojave
@AMBudnik AMBudnik self-assigned this Sep 27, 2019
@AMBudnik AMBudnik added this to the September 2019 milestone Sep 27, 2019
@AMBudnik AMBudnik changed the title The -after hooks for creating and removing rows/columns is not well described in the definition file The -after hooks for creating and removing rows/columns are not well described in the definition file Sep 27, 2019
@aninde
Copy link
Contributor

aninde commented Oct 10, 2019

Changes have taken place only in the definitions
5b0475e
bfdfaf5

Result in 7.1.2 7.2.0 is the same http://jsfiddle.net/aninde/0jmq54ky/ like in 7.1.1
but it is planned by design.

Screenshot 2019-10-10 at 18 14 25

@wojciechczerniak what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants