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
115
Igx grid column that comes from a dictionary
posted

I've got a simple class like so:

export class ProductionByMonth {
    producer: string;
    date: string;
    station: string;
    total: number;
    points: { [abbrev: string]: number };

    pointFor(abbrev: string): number {
        if (abbrev in this.points) {
            return this.points[abbrev];
        } else {
            return 0;
        }
    }
}

And I've got an array of 'abbrev' which contains all the keys that might appear in that `points` dictionary.  I can hardcode the igx-column entries for the first 4 items, but then I don't know how to do the points.

Every row will have the exact same keys in the points dictionary, all of which are in the abbrev array.