Hi,
everything working fine if I am using import Handsontable from ‘handsontable-pro’ in the below code, but when I try to use import from handsontable it will start giving mentioned error.
See if its can help to understand my issue.
import { HttpParams } from ‘@angular/common/http’;
import { Component, ViewChild } from ‘@angular/core’;
import { HotTableRegisterer } from ‘@handsontable/angular’;
import { Handsontable } from ‘handsontable-pro’;
@Component({
selector: ‘app-root’,
template: `
<hot-table [afterInit]=“onAfterInit” [hotId]=“id” [settings]=“hotSettings”>
`,
})
export class TestingHot {
public hotSettings: Handsontable.GridSettings = {
data: getData(),
colHeaders: getCols(),
bindRowsWithHeaders: true,
stretchH: ‘all’,
dropdownMenu: true,
filters: true,
allowRemoveColumn: false,
allowInsertColumn: false,
allowRemoveRow: false,
allowInsertRow: false,
hiddenColumns: {
columns: [0],
indicators: true,
copyPasteEnabled: true
},
cells(row, col) {
const cp = { readOnly: false, type: undefined, source: undefined };
if (col > -1 && col < 3) {
cp.readOnly = true;
} else if (col === 7) {
cp.type = ‘dropdown’;
cp.source = [‘NEW’, ‘USED’, ‘OLD’];
}
return cp;
}
};
public getData() {
return [
[“1”,“Tesla”, “Model 3”, “BlueStar”, “USA”, “★★★★”,“NEW”],
[“2”,“Tesla”, “Model S”, “WhiteStar”, “USA”, “★★★★★”,“NEW”],
[“3”,“Mitsubishi”, “iMiEV”, “”, “Japan”, “★★”,“NEW”],
[“4”,“Ford”, “Focus EV”, “”, “USA”, “★★”,“NEW”],
[“5”,“Mitsubishi”, “iMiEV Sport”, “”, “Japan”, “★★”,“NEW”],
[“6”,“Tesla”, “Roadster”, “DarkStar”, “USA”, “★★★★★”,“USED”],
[“7”,“Volkswagen”, “e-Golf”,"", “Germany”, “★★”,“USED”],
[“8”,“Volkswagen”, “E-Up!”, “”, “Germany”, “★★”,“NEW”],
[“9”,“Ford”, “C-Max Energi”, “”, “USA”, “★”,“NEW”],
[“10”,“BYD”, “Denza”, “”, “China”, “★★★”,“OLD”],
[“11”,“BYD”, “e5”, “”, “China”, “★★★”,“NEW”],
[“12”,“BYD”, “e6”, “”, “China”, “★★★★”,“NEW”]
];
}
public getCols() {
return [“id”,“Brand”, “Model”, “Code name”, “Country of origin”, “Rank”,“Status”];
}
}