Custom ID

优质
小牛编辑
116浏览
2023-12-01

You can easily pass id and other attributes to the hot-table wrapper element.
It will be applied to the root Handsontable element, allowing further customization of the table.

// app.component.ts import { Component } from '@angular/core'; import * as Handsontable from 'handsontable'; @Component({ selector: 'app-root', template: ` `, }) class AppComponent { hotSettings: Handsontable.GridSettings = { startRows: 5, startCols: 5, colHeaders: true, stretchH: 'all' }; id = 'my-custom-id'; } // app.module.ts import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { HotTableModule } from '@handsontable/angular'; @NgModule({ imports: [ BrowserModule, HotTableModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) class AppModule { } // bootstrap import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; platformBrowserDynamic().bootstrapModule(AppModule).catch(err => { console.error(err) });

Edit this page