Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Two filter modes in tree grid
posted

https://www.infragistics.com/products/ignite-ui-angular/angular/components/treegrid/filtering?&_ga=2.41660837.641339171.1661806775-427916230.1569865702#angular-tree-grid-filtering-example

You can enable both the quickFilter/excelStyleFilter and the advanced filtering user interfaces in the Tree Grid. Both filtering user interfaces will work independently of one another. The final filtered result in the Tree Grid is the intersection between the results of the two filters.

how can I achieve it?

Parents Reply
  • 400
    Offline posted in reply to Avis R

    Hello Avis,

    Thank you for following up.

    After further investigation, it appears that by design you can choose between the two filter modes - either quickFilter or excelStyleFilter. This is the reason why when you set a mod in the filterMode property of the grid for example excelStyleFilter it applies and overrides the templates of the default quickFilter mod. However, I can suggest another workaround approach that comes closer to the described scenarios.

    What I could suggest is something in common between column template and external excel style filtering components. The igx-tree-grid will be in the default quickFilter mode and the columns with a given icon will be templated, which in turn will expand or hide an external excel filter dialog for the tree grid with the *ngif directive, depending on which column the icon is clicked on. After expanding the dialog, it will be able to filter the given column by applying all the filters from the excel filter mode. The only drawback to the workaround is that the cancel button will not close the filter dialog, this reason is due to the fact that when using a stand-alone igx-grid-excel-style-filtering component as a column template it is not fully relayed to the column due to not using the excelStyleFilter mode and not being deployed from the column header as per default, but it will still be able to be closed from the icon in the template. However, a fully functional excel style filtering dialog relayed and filtering a given column is implemented, which is combined with individual quickFilter templates.

    <ng-template #excelStyleTemplateName igxFilterCellTemplate>
                <igx-icon (click)="showNameFunc()">filter_alt</igx-icon>
    </ng-template>

    <div class="filter-dialog" *ngIf="showName">
            <igx-grid-excel-style-filtering [column]="treegrid1.getColumnByName('Name')">
            </igx-grid-excel-style-filtering>
    </div>

    Additionally, what can be done is to use Advanced Filtering as a combination of the two previous filter mods and a refinement with more capabilities.

    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.

    Regards,

    Georgi Anastasov

    Entry Level Software Developer

    Infragistics

Children
No Data