Hello,
In the process of making an Excel-style filtering on an iggrid, I would like to hide or add some custom filter conditions after displaying the grid.
For hiding, I already saw that: https://www.infragistics.com/community/forums/f/ignite-ui-for-javascript/97384/iggrid-filter-how-to-hide-filter-menu-condition-options, but is there any way to do so without parsing all the DOM? Isn't there any way to intervene on the custom filter conditions ?
Especially since I'm going to add many filter conditions, I would rather have it in data than in display :)
Another possibility would be to point me to another control that allows excel-style filtering, while allowing hiding columns, sorting, grouping, available in ASP.NET or jQuery.
Thanks !
Hello Arthur,
The only way to hide a filter condition from the list is by removing it as a DOM element from the list of filters.
To add a custom filter on initialization there is an igGridFiltering option in the columnSettings called customConditions. I have attached a sample, demonstrating how it is used. You can find more information about this option here. To add a custom filter after initialization the grid has to be destroyed and created again with the new filter, added in its customConditions option.
Please feel free to contact me if you have further questions.
Regards,Ivaylo HubenovEntry-level developer
Hello Ivaylo,
Would you be so kind as to give me guidelines on how I can destroy and recreate the grid client-side ? It would be a huge step forward, since I don't really want to reload the page.
Best regards,
Arthur
To recreate the grid:1) destroy the old one - $("#grid").igGrid("destroy");2) initialize the grid with the options/features it had before but also add the columnSettings, containing the options for the filtering list.
Add the mentioned above points in a function and call it on some kind of event.
I have attached a sample, demonstrating how the grid is recreated with two options added in the filtering list on button click.
Well, sorry, I didn't have time to check it out, but what you explained and the concept of it seems right on point !
Thank you so much !
I'll later dig more deeply into the example to validate the answer.
Take your time to test the sample and let me know if you need assistance.
It really works wonders. I simply had to re-apply the filters by catching the iggriddatafiltered event, rebuild the features, destroy, recreate, re-apply filters.
Thanks so much,
Arthur Yvrard