conditional class adding by row value

conditional class adding by row value

rotem400rotem400 Posts: 1Questions: 1Answers: 0
edited September 2016 in Free community support

hi

I have a column which value is a storage in giga bytes.
for example: "20" (which means 20 GB)
in case it's less than 1 GB, (for example 500 mb) it appears as so: "0.5"

What I want to do is add a class to that column if it's less than 1 GB.

this is what I tried so far and didn't work:

"columnDefs": [
{
    render: function ( data, type, row ) {
        if(data < 1){
            className: "megaBytes";
        } 
                    
        return data;
    },
    "targets": 6,
},
]

it's column 6.

by the way I do not want to manipulate the data itself.

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.