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
Perceived sorting related bug when generating igx-columns iteratively
posted

For my project I am using an igx-grid.

Creating every column manually works just fine and as intended but for design reasons (because the gid we used before was build this way) we want to fill it with a data structure similar to this

       tableFields = [
        {
            name: "Product ID ",
            field: "ProductID",
            sortable: false,
            
        },
        {
            name: "Product Name",
            field: "ProductName",
            sortable: false,
        },
        {
            name: "OrderDate",
            field: "OrderDate",
            sortable: false,
        }
    ];

With this structure my goal is to fill the igx-columns iteratively like this

        <div *ngFor="let column of tableFields">
          <igx-column field="{{column.field}}" header="{{column.Name}}" sortable="{{column.sortable}}"></igx-column>
        </div>

Sadly this leads to very weird bugs concerning the sortable-attribute. I prepared a stackblitz for this, but long story short, as soon as I have iteration in there sortable is always true, even if I explicitly set it false in the loop.