Hello team,
Requirement: I have igx data grid that displays grid data dynamically(Programmatically). As it is the same Igx grid but the data source can be generated dynamically.Please help how can i achieve the same stated above.
This important information I should have known sooner Donkey kong
Hello Shobhana,
Thank you for following up!
After looking into your question, what I could suggest in order to determine whether the data is filtered is using the IgxGrid’s filteredData property which gets/sets an array of objects containing the filtered data or using the IgxGrid’s filteringExpressionsTree property and more specifically its filteringOperands property which contains an array of IFilteringExpressionsTree. If this array is empty, then no filtering is applied.
let isFiltered = this.grid.filteredData?.length > 0; // OR let isFiltered = this.grid.filteringExpressionsTree.filteringOperands.length > 0;
Please test it on your side and let me know if you need any further assistance regarding this matter.
Looking forward to your reply.
Sincerely,Riva IvanovaEntry Level Software Developer
Hello Riva,
My requirement is one set of data is filtered data and another set is non-filtered data. It is same igx grid html i am using. But how can i tell programmatically weather i am in grid with filtered data or non-filtered data.
I have been looking into your additional question regarding having multiple grids in a single grid html template, however, what I could say is that, at this point, we do not provide this functionality out of the box. Every IgxGrid should me defined separately in the html file as this is required for the IgxGrid features like filtering, selection, column pinning, column hiding, etc., to have a specific instance of the component in order to work properly and as expected.
Additionally, could you please provide additional details regarding your requirement? Do you require, for example, having two IgxGrids, one with filtering and row selection enabled and another having an IgxPaginator and an IgxToolbar, and on a certain condition, e.g., button click, to display the first grid and on another button click to display the other one?
For such scenarios as the abovementioned one, what I could suggest is defining the IgxGrids in the html file with all required features enabled and using an *ngIf directive to display the required IgxGrid when needed.
This could be observed in the below attachment:
Here could be found a small sample demonstrating my suggestion. Please test it on your side and let me know if you need any further assistance regarding this matter.
Thank u for fast reply. Can u pls tell me if i can have multiple grid in the same grid html? Instead of <igx-grid #grid1 [data] = "data"> can i have <igx-grid [grid]= "grid1" [data] = "data">Please reply.