team_aras_meupe_com
3 years agoCreator III
background-color in TOC
Hello, I am trying to change the background color of a cell in the TOC. I have based on AngelaP's code in git, but I can't change anything. Any suggestions?
My ARAS is version 11.0 SP9
This is angela GItHub: Impact Matrix Color
for (int i = 0; i < this.getItemCount() - 1; i++)
{
// Declaración de variables
string bg_color_state;
string myCss = "";
// Obtener el elemento en la posición i
Item thisItem = this.getItemByIndex(i);
// Obtener el valor de la propiedad "mp_lpve_posicion" del elemento actual
string thisStatus = thisItem.getProperty("mp_lpve_posicion", "");
// Establecer el color de fondo del estado en "#FFFFBB" (amarillo claro)
bg_color_state = "#FFFFBB";
// Construir una cadena de estilo CSS para el elemento actual
myCss = ".state { background-color: " + bg_color_state + " }";
// Establecer la propiedad "css" del elemento actual con la cadena de estilo CSS
thisItem.setProperty("css", myCss);
}
// Devolver el objeto actual
return this;The sample is a bit buggy I so far haven´t updated it.
Don´t use the -1 in the for loop -> for (int i = 0; i < this.getItemCount(); i++)
If you want to color a custom property, you have to change the "mycss"-part -> so instead of .state use .mp_lpve_posicion .
The sample is basically a C# variant of the common VB solution in this forum. Color schema is optimized for Innovator 11, for Innovator 12 I would use different colors that are a bit stronger. :)