Grid - Aggregate functions - First - throws error when data on column is null

Posted by: andrei.iacob on 22 November 2024, 6:52 am EST

  • Posted 22 November 2024, 6:52 am EST - Updated 22 November 2024, 6:57 am EST

    Hello,

    There is a bug in the Grid with aggregate functions

    If we use this link for reference:

    https://developer.mescius.com/wijmo/demos/Grid/Aggregation/Customaggregation/angular

    and then change in the app.component.html sales column to:

    <wj-flex-grid-column [binding]=“‘sales’” [header]=“‘Sales’” [aggregate]=“‘First’”>

    and then change in the app.component.ts sales data to null:

    private _getData() {

    // create some random data

    let countries = ‘US,Germany,UK,Japan,Italy,Greece’.split(‘,’),

    products = ‘Phones,Computers,Cameras,Stereos’.split(‘,’),

    data = ;

    for (let i = 0; i < 200; i++) {

    data.push({

    id: i,

    country: countries[i % countries.length],

    product: products[i % products.length],

    sales: null, //Math.random() * 10000,

    expenses: Math.random() * 5000

    });

    }

        return data;
    }
    

    and then run the app the grid will be broken and the error will be:

    “ERROR Invalid aggregate type.”

    This is happening only for ‘First’ aggregate function… if we change it to ‘Last’ it will work properly

  • Posted 22 November 2024, 6:54 am EST - Updated 22 November 2024, 7:00 am EST

    I added 2 more images so it will be more clear.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels