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
15
How can I enable sorting/filtering/grouping toolbar on UI Grid in angular with autoGenerate=true
posted

I have a grid that is re purposed for different types of data. I saw an example of enabling "features" in non-angular implementation to enable sorting/filtering globally on grid.

But when I try to enable "features" like below

  <igx-grid #grid1 id="grid1" [data]="rowData" [autoGenerate]="true">
<features>
<feature name="Sorting">
</feature>
</features>
</igx-grid>


I get error -
Uncaught Error: Template parse errors:
'feature' is not a known element:
1. If 'feature' is an Angular component, then verify that it is part of this module.
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
<igx-grid #grid1 id="grid1" [data]="rowData" [autoGenerate]="true">
<features>
[ERROR ->]<feature name="Sorting">
</feature>
</features>
"): ng:///AppModule/AddnewComponent.html@123:8
Parents
  • 1300
    Offline posted

    Hello Pranay,

    In the igx-grid sorting could be achieved with the following lines of code:

    <igx-column field="ProductName" header="Product Name" [dataType]="'string'" sortable="true"></igx-column>

    Filtering could be achieved with these lines:

    <igx-grid #grid1 [data]="data" [autoGenerate]="false" [allowFiltering]="true">

    More information about sorting and filtering could be found in our documentation: Grid Sorting Overview and Grid Filtering Overview.

    You can also have filtering and sorting that can be turned on using buttons. There is a sample, which is described in the Data Grid Overview and Configuration in State persistence topic.

    Looking forward to hearing from you.

    Regards,

    Monika Kirkova,

    Infragistics

Reply Children