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

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

    • Post Options:
    • Link

    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.

  • Posted 25 November 2024, 3:13 am EST

    Hi Andrei,

    It seems that the issue is fixed in the latest nightly build. I would suggest you to update Wijmo packages to version 5.20242.23-nightly.d20241122.t020139

    For reference, please check the following sample application: Sample

  • Posted 26 November 2024, 5:54 am EST

    Hello,

    Yes it’s working with that version.

    Thanks.

Need extra support?

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

Learn More

Forum Channels