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 Silvia,
Thank you for posting to Infragistics Community!
I have been looking into your question and my suggestion is to use an igx-icon in the igx-suffix of the select component. On the click event of the icon will execute a method that will be given two arguments: the cell and the event itself. In the method, you can set a new value to the cell as the placeholder or simply set an empty string, and with the event you can also prevent the drop-down container from opening. This will reset the igx-select value and achieve your requirements.
In addition, I have prepared a small sample illustrating my suggestion which could be found here.
Please test it on your side and let me know if you need any further assistance with this matter.
Regards,
Georgi Anastasov
Software Developer
Infragistics
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?