Thanks, Aleksandra for your response. Below is the error:
error===> TypeError: Cannot read property ‘nodeType’ of undefined
at isHotTable (element.js:177)
at isChildOfWebComponentTable (element.js:181)
at new Core (core.js:123)
at new Handsontable (index.js:45)
at o.initialiseHandsOnTable (pnF_HandsonTablePOCLWC.js:4)
at eval (pnF_HandsonTablePOCLWC.js:4)
I am using v7.4.2 with licenses.
Here is the js:
import { LightningElement } from ‘lwc’;
import { loadScript, loadStyle } from ‘lightning/platformResourceLoader’;
import handsonTableResource from ‘@salesforce/resourceUrl/Handsontable_7’;
export default class PnF_HandsonTablePOCLWC extends LightningElement {
dataObject = [ { id: 1, currency: 'Euro' },{ id: 2, currency: 'Japanese Yen'}];
renderedCallback() {
Promise.all([
loadScript(this, handsonTableResource + '/Handsontable_7/handsontable-master/dist/handsontable.js'),
loadStyle(this, handsonTableResource + '/Handsontable_7/handsontable-master/dist/handsontable.css'),
])
.then(() => { this.initialiseHandsOnTable(); })
.catch(error => {
alert('error3xxxxx');
alert(error);
console.log('error===>', error);
});
}
hotElement;
hotSettings;
initialiseHandsOnTable() {
this.hotElement = this.template.querySelector('div.hotElement');
this.hotSettings = {
data: this.dataObject,
columns: [{ data: 'id', type: 'numeric', width: 40 }, { data: 'currency', type: 'text' }],
rowHeaders: true,
colHeaders: [ 'ID','Currency']
};
new Handsontable(this.hotElement, this.hotSettings);
}
}
Is Handsontable library support LWC? If not, we can go back to VF page implementation.
Appreciate all your help.
Thank you.