what
what

Reputation: 348

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!

enter image description here

Upvotes: 1

Views: 8235

Answers (1)

kamil-kubicki
kamil-kubicki

Reputation: 628

As found in documentation https://www.ag-grid.com/javascript-grid-row-styles/:

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;
    }
}

Upvotes: 3

Related Questions