Posted 24 June 2019, 10:00 pm EST
Hello,
You may simply add a button and handle its click event. In the click event, assign the data source as the itemsSource of the sheet of FlexSheet and also assign the formatItem method as the itemFormatter of the FlexSheet. Please refer to the code snippet below:
HTML:
<wj-flex-sheet #formatSheet (initialized)="formatSheetInit(formatSheet)">
<wj-sheet name="Data" [rowCount]="20" [columnCount]="8"></wj-sheet>
</wj-flex-sheet><br><br>
<button (click)="bindData()">Bind Data</button>
TS:
bindData() {
this.formatSheet.selectedSheet.itemsSource = this.source;
this.formatSheet.itemFormatter = this.formatItem;
}
You may also refer to the sample below:
https://stackblitz.com/edit/angular-3nxbxe