Handsontable: beforeInit hook never fires

Created on 2 Apr 2019  路  3Comments  路  Source: handsontable/handsontable

Description


beforeInit hook never fires. afterInit hook fires fine.

Edit: It works with a global hook (example: http://jsfiddle.net/g23ufym7/). If it doesn't work as a regular table option then maybe update the documentation to specify that you can't use it as a setting for the constructor.

Steps to reproduce

  1. Add a beforeInit hook
  2. It won't fire

Demo


http://jsfiddle.net/t3pL46q5/

Your environment

  • Handsontable version: 6.0.1
  • Browser Name and version: Chrome Version 69.0.3497.100
  • Operating System: Windows 10
callbacks handsontable few hours Bug

Most helpful comment

After playing with hooks and beforeInit hook I came to the conclusion that this is a bug.

The beforeInit hook is fired before any previously added listener to the Handsontable (local hooks added using settings object). So it's impossible to listen to that hook.

Fired at https://github.com/handsontable/handsontable/blob/master/src/core.js#L854 but listeners just added here https://github.com/handsontable/handsontable/blob/master/src/core.js#L860.

All 3 comments

Hey @jeremy-smith-maco

I can see that we had a similar report here https://github.com/handsontable/handsontable/issues/3819 and here's another tip from our developer https://github.com/handsontable/handsontable/issues/2636

[...] beforeInit (fired before table created) or construct (fired on object initialization - new Handsontable) event will be usefull for you? But this events are fired only once during initialization.

After playing with hooks and beforeInit hook I came to the conclusion that this is a bug.

The beforeInit hook is fired before any previously added listener to the Handsontable (local hooks added using settings object). So it's impossible to listen to that hook.

Fired at https://github.com/handsontable/handsontable/blob/master/src/core.js#L854 but listeners just added here https://github.com/handsontable/handsontable/blob/master/src/core.js#L860.

This issue is still replicable using v8.0.0. Here's an updated demo - https://jsfiddle.net/0rL31km7/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

astegmaier picture astegmaier  路  3Comments

zoladkow picture zoladkow  路  3Comments

wszymanski picture wszymanski  路  3Comments

paulo-raca picture paulo-raca  路  3Comments

snelson87 picture snelson87  路  3Comments