AnsweredAssumed Answered

CDE - Table component - AddIns formatting circle color

Question asked by B523W5TI on Feb 28, 2018
Latest reply on Mar 5, 2018 by Paulo Pires

Hello,

 

I need to format the cells of 4 columns (by right side) in "circle" (with "AddIns" option) through the function of value on First column of the table. I.E.:

 

1) First column value: "param1"

   Third column: circle (if value <80 then RED else GREEN)

 

2) First column value: "param2"

   Third column: circle (if value <50 then RED else GREEN)

  

3) First column value: "param3"

   Third column: circle (if value <40 then RED else GREEN)

  

I've created the following javascript code (In Pre-Execution) with no success:

 

function f()

{

    this.setAddInOptions("colType","string",function(st)

    {

    if(st.colIdx == "0" && st.value == "param1")

    {

        this.setAddInOptions("colType","circle",function(st2)

    {

            return{      

            canvasSize: 15,

            radius: 5,

            color: function(st2)

            {   

                if(st2.value <=50)

                {

                    return "red";

                }

                else if(st2.value>50 && st2.value <=80)

                {

                    return "yellow";

                }

                else

                {

                    return "green";

                }

            }

            };

    });

    }

    });

}

 

 

Can anyone help me?

Outcomes