Hi Team,
I am using Igx Data grid in my project.
Scenario: Using Excel style filter, to filter the grid and get the filtered data.
Requirement: On click of Delete button, only should Delete the filtered data and not the grid data.
Expected Result: Only Delete the filtered data,
Hello,
I am glad that you find my suggestion helpful.
Thank you for using Infragistics components.
Regards,
Georgi Anastasov
Entry Level Software Developer
Infragistics
This works. Thank you for all the help!! Appreciate it.
Thank you for following up and for the provided information.
What I could suggest achieving your requirements is to handle another igx-grid component event which is filteringExpressionsTreeChange.
<igx-grid #grid [data]="data" [primaryKey]="'ProductID'" [autoGenerate]="false" height="600px" width="100%" [allowFiltering]="true" [filterMode]="'excelStyleFilter'" (filteringExpressionsTreeChange)="filteringExprTreeChange($event)" ></igx-grid>
The event is fired after filtering a given grid column and immediately after that you can enable or if the filters are cleared you can disable the given button.
public filteringExprTreeChange(event){ if(event.filteringOperands.length > 0){ this.disabled = false; }else { this.disabled = true; } }
The described scenario could be observed here:
I have prepared small sample illustrating my suggestion which could be found here. Please test it on your side and let me know how it behaves.
If you require any further assistance on the matter, please let me know.
Hello Georgi,I am using Infragistics 9.1.16 version.I am trying to trigger the filtering event in Igx-data grid. I tried with both ways to trigger event i.e. onfilteringdone event and filtering event mentioned as above.But i am not getting anything on console.I am trying to enable/disable the delete button based on filtered data.
I have trying to reproduce the described behavior. I am using igx-grid component with allowFiltering property set to true and Excel Style Filter, columns filterable property also set to true. On my side when I handle onFilteringDone event it gets triggered and I get the event on the console, everything works as expected and I am able to handle the event.
In order to ensure that your issue is addressed correctly, I will need some additional information regarding your scenario. Can you please answer the following questions:
This information is going to be highly appreciated and will help me in my further investigation.
However if you use the button disable and enable event as in the sample I provided what you need to do is change the event accessor as in the if check instead of:
event.filteringExpressions.filteringOperands.length > 0
You will usе:
event.filteringOperands.length > 0