Page 1 of 1

[ANGULAR] problem of renderer color when reorder rows

Posted: Wed Mar 29, 2023 4:03 am
by boyitech

Greetings!

I find a problem when I use 'Grid.feature.RowReorder' . I add a renderer to change the cell's color when the value is 99 and it works. However, when I try to reorder this row to other place, the row which be replaced will also be colored.

Image
Image


Re: [ANGULAR] problem of renderer color when reorder rows

Posted: Wed Mar 29, 2023 7:43 am
by tasnim

Hi,

You need to add an else statement for that

        renderer : ({ cellElement, value }) => {
            if (value === 30) {
                cellElement.style.color = 'white';
                cellElement.style.background = 'green';
            } else {
                cellElement.style.color = null;
                cellElement.style.background = null;
            }
            return value;
        }

This will work