Since I could not find any information, I am writing here. How can I reset a selected value of igx-select using typescript:
Here is my HTML-Code:
<igx-select #selectDepartment placeholder="Wähle Abteilung" [overlaySettings]="overlaySettings" [ngClass]="[cell.row.deleted?'upfont' : 'drop-down-grid']" [(ngModel)]="cell.value"> <igx-select-item style="font-size: 12px;" *ngFor="let item of arrayDepartments" [value]="item"> {{ item }} </igx-select-item> </igx-select>
Is there any way to delete the value of the cell and show the placeholder when for example a button is clicked?
Hello,I am glad that you find my suggestion helpful. Thank you for using Infragistics components!
Regards,
Georgi Anastasov
Software Developer
Infragistics
Perfect! Thank you very very much. The example was very helpful!
Hello Silvia,
Thank you for clarifying your requirement.
My suggestion is to use the getCellByColumn method of the grid to access the cell with the igx-select editor, for example:
public resetSelect(cell: IgxGridCell){ let previousCellOnRow = this.grid1.getCellByColumn(cell.id.rowIndex,'departament'); previousCellOnRow.value = 'Choose a departament'; }
Thus, its value could be reset upon clicking on a button in another column of the same row.
I have modified the previous sample illustrating my suggestion which could be found here.
Please test it on your side and let me know whether you find it helpful.
I tried to adapt your example to my columns, but because of the event parameter (I suggest) I could not get it working.
Thank you for the example. Actually I have an extra column where the selected value of the igx-select can be confirmed or denied. In both cases I want to delete the value of the igx-select through a button of a separate column.
Here is a screenshot of the columns.
Is this possible using Ignite UI and typescript?