How to Add Dynamic Row Class in Ag-Grid Table

I am using ag-grid.com, does anyone know how to add dynamic row class name in the same table? So that I can set different background color base on it.

Thanks in advance!

1

1 Answer

As found in documentation :

var gridOptions = {
    rowData: rowData,
    columnDefs: columnDefs,
    rowClassRules: {
        'your-class': function(params) {
            return your_condition;
        }
    }
};

and in vuejs it might look like:

this.rowClassRules: {
    'your-class': params => {
          return your_condition;
    }
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest