I need to filter every sub grid, searching for a particular string. My app has an input and a hierarchical grid similar to the one in the following example: https://ko.infragistics.com/products/ignite-ui-angular/angular/components/hierarchicalgrid/filtering
For example, every album in every sub grid that contains the word "house". Is there a way to filter programatically sub grids inside the hierarchical grid?
I've tried naming the row island and calling filter() and filterGlobal() methods with no success.
Thanks
Hello,
The samples above already show how to filter the grid programmatically. I am not sure what do you mean by not showing the filtering UI, but I suppose you can just remove [allowFiltering]="true" from the grid/rowisland, and the filtering options for the user will no longer be accessible, while setting them from code will continue to work.
Sincerely,Tihomir TonevAssociate Software DeveloperInfragistics
One last question.
Is there a way to filter the grid programatically, without showing in the UI the filter applied?
Thank you
Yes, you can apply more than one condition to the same column. Just push all the filtering operands to the FilteringExpressionTree and set it to the rowIsland. For instance:
const tree = new FilteringExpressionsTree(FilteringLogic.Or); tree.filteringOperands.push({ fieldName: "Album", condition: IgxStringFilteringOperand.instance().condition("contains"), searchVal: input, ignoreCase: true }); tree.filteringOperands.push({ fieldName: "Album", condition: IgxStringFilteringOperand.instance().condition("contains"), searchVal: "the", ignoreCase: true }); x.filteringExpressionsTree = tree;
This will search the column "Album" for either the input typed, or for the string "the".
Regarding your second question, there seems to be an issue with calling filtering functions on rowIsland, and I have logged the following entry in our git repository. Please subscribe to the thread so you can receive notifications when this is going to be resolved.
As a workaround, if you are looking to clear the filter, you can assign an empty tree instead:
Should you have any further queries, please let me know.
Thank you for your response!. The sample you provided pointed me in the right direction.
Is it possible to filter the same column by two different values?
Also, i've tried clearing the filter applied but the following code did no effect:
Thank you for reaching out.
While filtering the grids is possible, searching for the results will be a lot more complicated.
Please have a look at the following sample, where you can see how to filter subgrids:
https://stackblitz.com/edit/hierarchicalgrid-filter-chldren?file=src%2Fapp%2Fhierarchical-grid%2Fhierarchical-grid-filtering%2Fhierarchical-grid-filtering.component.ts
While this will technically filter the grid, it will not search for the results, and searching rather than filtering at this point is a feature request. You can submit feature request in our GitHub repository here.
Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case.
This will give you the opportunity do directly communicate with our development team regarding the issue and get notifications whenever a new information is available.
Please let me know if you need any further assistance.