AnsweredAssumed Answered

CDE Table component: How to color cell entirely

Question asked by B523W5TI on Mar 6, 2018
Latest reply on Mar 6, 2018 by B523W5TI

Hello,

 

I need to color the entirely cell of a table (screenshot attached).

Due to some cells very large, my cell do not color entirely.

Untitled.png

 

So my code (Pre_Ececution) is the follow:

function f(){ 

    this.setAddInOptions("colType","formattedText",function(state){

        var priorita = state.tableData[state.rowIdx][2];

        var stato = state.tableData[state.rowIdx][3];

        if(state.colIdx === 0)

        {

            if(priorita == '1 - Critico' && (stato == 'Assegnato' || stato == 'In Lavorazione')){

                    return {  textFormat: function(v, st) { return "<div style='background:red;'>"+v+"</div>"; } };

                 }

            else if(priorita == '2 - Alto' && (stato == 'Assegnato' || stato == 'In Lavorazione')){

                    return {  textFormat: function(v, st) { return "<div style='background:orange;'>"+v+"</div>"} };

                 }

        }

      });

}

 

How can I color the entire cell?

 

Regards,

Ema

Outcomes