Posted 22 August 2022, 3:19 pm EST - Updated 3 October 2022, 10:40 pm EST
Hi there,
We use wijmo grid for our rostering functionality. Where employee column can be merged across multiple rows depending on number of rosters in the grid.In this column we have Employee name as well as button available next to it which has a different child component loading on its click event. But this button should only be available for current focused cell. Not for all cells in this column. Is there a cell focus event I can set ? I have tried through grid formatItem property but behaves commonly for all cells in this columns. Higher level code I have provided below.
<wj-flex-grid
#grid
[itemsSource]="_gridData"
[alternatingRowStep]="0"
[selectionMode]="'ListBox'"
[allowMerging]="'Cells'"
[allowDragging]="'Columns'"
(formatItem)="styleCell($event)"
(selectionChanged)="onSelectionChanged($event)"
(initialized)="initGrid(grid)">
<wj-flex-grid-column
*ngIf="userOptions.employeeName"
[header]="'Name'"
[binding]="'employeeName'"
[isReadOnly]="true"
[allowDragging]="false"
[allowMerging]="true"
[minWidth]=200
width="*">
<ng-template wjFlexGridCellTemplate [cellType]="'Cell'" let-cell="cell" style="padding-right: 0px" [autoSizeRows]="false" >
<button *ngIf="showConvertButton" class="convert" (click)="commands.convertCommand.executeCommand()" >...</button>
{{cell.item.employeeName}}
</ng-template>
</wj-flex-grid-column>
</wj-flex-grid>
on .ts file
styleCell(event: wjcGrid.FormatItemEventArgs): void {
if (panel.cellType === wjcGrid.CellType.Cell && colBinding == 'employeeName') {
const cell = grid.cells.getCellElement(event.row, event.col);
cell.addEventListener('focus', () => {
//based on condition
this.showConvertButton = true;
});
cell.addEventListener('focusout', () => {
this.showConvertButton = false;
});
}
}
And the behaviour you can see in this image below.
Also we are looking for a solution to be able to select all rows where merged cell is clicked/focused and have asked in a separate topic * “General Discussion | GrapeCity Forums” but waiting on reply for that too.
Thank you in advance.
We need to select all rows when