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
50
Igx grid sum of selected rows
posted

Hi Team,

I'm using igniteui-angular package with version 8.0.3 and using in angular project with angular version 6.

In igx-grid, I want the sum of a column for the selected rows only( rows with check-boxes checked). Please help/guide me to achieve the same.

Thanks & Regards,

Akshay

Parents
  • 50
    Offline posted

    Thanks Petko!

    I'm able to calculate the sum of selected rows.

    Also, I'm using summaries attribute on igx-column like as below : 

    [summaries]="sumSummary"

    class SumSummary extends IgxNumberSummaryOperand {
    constructor() {
    super();
    }

    public operate(data?: any[]): IgxSummaryResult[] {
    const result = [];
    result.push({
    key: "sum",
    label: "",
    summaryResult: IgxNumberSummaryOperand.sum(data)
    });
    return result;
    }
    }

    is there any way where i can assign my custom selected rows sum to the summeries.
    Do i need to call operate function explicitly? OR
    showing sum on custom div instead of using summeries attribute would be easier?


    Thanks,
    Akshay
Reply Children
No Data