angular wijmo flexgrid将唯一id添加到网格单元
我是wijmo网格的新手。我想为wijmoflexgrid中的每个单元格添加唯一的id。 有谁能帮助实现这一目标angular wijmo flexgrid将唯一id添加到网格单元,angular,wijmo-grid,Angular,Wijmo Grid,我是wijmo网格的新手。我想为wijmoflexgrid中的每个单元格添加唯一的id。 有谁能帮助实现这一目标 谢谢您需要处理FlexGrid的formatItem事件,并为每个单元格添加不同的id <wj-flex-grid [itemsSource]="source" (formatItem)="onFormatItem(grid, $event)" #grid> <wj-flex-grid-column header="Country" binding="count
谢谢您需要处理FlexGrid的formatItem事件,并为每个单元格添加不同的id
<wj-flex-grid [itemsSource]="source" (formatItem)="onFormatItem(grid, $event)" #grid>
<wj-flex-grid-column header="Country" binding="country"></wj-flex-grid-column>
<wj-flex-grid-column header="Date" binding="date"></wj-flex-grid-column>
<wj-flex-grid-column header="Amount" binding="amount"></wj-flex-grid-column>
</wj-flex-grid>
onFormatItem(s, e) {
if(s.cells === e.panel) {
e.cell.setAttribute('id', `row-${e.row}-col-${e.col}`);
}
}
onFormatItem(s,e){
如果(s.单元===e.面板){
e、 setAttribute('id','row-${e.row}-col-${e.col}');
}
}
我已经创建了一个示例进行演示: