DataTable multiple Filter conditions in one

#1

Hi all,

I’m using the conditional cell styling to color rows based on two conditions:

{
    'if': {
        'filter' : 'p_strike_pro < num(0.0)'
    },
    'backgroundColor':'#4E5066',
    'color':'#FFFFFF'
},
{
    'if': {
        'filter' : 'c_strike_pro < num(0.0)'
    },
    'backgroundColor':'#4E5066',
    'color':'#FFFFFF'
}, 

I wonder if there is a way to “concat” those two conditions into one, e.g. 'filter' : 'c_strike_pro < num(0.0) OR p_strike_pro < num(0.0)'?

Many thanks in advance!

#2

so far, the way you have done it is the only way…as it stands now, conditional arguments (OR, AND, etc) are not supported. hopefully conditional formatting with conditional arguments will be forthcoming in a future release.

#3

I figured that an AND condition seems to work like this

{
    'if': {
        'row_index': 'odd',
        'filter' : 'p_strike_pro > num(0.0)',
        'filter' : 'c_strike_pro > num(0.0)',
    },
    'backgroundColor':'#EBEBEB',
}, 

At least that works for me.