Hooks for Handsontable in the entire application

Tags: #<Tag:0x00007efc6528eae8>

Using Handsontable + Angular wrapper, how do we add hooks(e.g. afterInit) to Handsontsable so that it applies for all Handsontables in the entire application?

Hi @oommen.alex

Would this work for you https://jsfiddle.net/AMBudnik/qr2czvk7/ or do you plan to have a different structure of the project?

@aleksandra_budnik In the above example we are adding the after init code in the component. So it will be applicable to the Handsontable instance of this particular component only. If we need the same functionality for another Hnadsontable in another component, we will need to duplicate the same code again. I was looking for a way, where we can centrally add this functionality and it will get reflected to all Handsontable instances created.

@oommen.alex That’s understandable if you want to cross share the logic between more than a single instance. We do not have a demo for that. But let me check some of the options. I’ll be back in a bit.

@aleksandra_budnik Is there a demo similar to https://jsfiddle.net/AMBudnik/qr2czvk7/ but with Angular v13.

Latest Handsontable for Angular was pre-tested with Angular 13, so you can just replace the resources from

https://cdn.jsdelivr.net/npm/@handsontable/angular@6.0.1/bundles/handsontable-angular.umd.min.js
https://cdn.jsdelivr.net/npm/handsontable@8.2.0/dist/handsontable.full.min.js
https://cdn.jsdelivr.net/npm/handsontable@8.2.0/dist/handsontable.full.min.css

to

https://cdn.jsdelivr.net/npm/@handsontable/angular@11.1/bundles/handsontable-angular.umd.min.js
https://cdn.jsdelivr.net/npm/handsontable@11.1/dist/handsontable.full.min.js
https://cdn.jsdelivr.net/npm/handsontable@11.1/dist/handsontable.full.min.css