This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Change colors of columns in the right pane window

CycleOp - Tuesday, June 26, 2012 3:23 AM:

Hi guys,

Does anyone have an idea on how to change the main window, where users are able to search for their parts, so that a one column would have a specific color (red) and another column would be blue ?

 

Thought about using one of the CSS or XSL files and tweak them.

 

Thanks.

Sagi



Brian - Tuesday, June 26, 2012 8:04 AM:

Hi Sagi,

You can use an onAfterGet method for the item type:

The method code following will set the "state" property to a different colour depending on the state in question.

 

C# method. onAfterGet.

Also sets the font color

for (int i=0; i < this.getItemCount(); i++){

 

  string bg_color;

  string myCss;

  string text_color = "#000000";

  Item thisItem = this.getItemByIndex(i);

  string thisStatus = thisItem.getProperty("state","");

    //------

      switch (thisStatus){

          case "Preliminary":

          case "In Review":

          bg_color = "#FFFFBB"; //'light yellow

          text_color = "#ff0000";

          break;

          case "Released":

          bg_color = "#90EE90";// 'light green

          text_color = "#993300";

          break;

          case "Superseded":

          case "Obsolete":

          bg_color = "#FFBBBB";// 'light red

          text_color = "#663399";

          break;

          default:

          bg_color = ""; //none

          break;

      }

 

  if (bg_color != "" ){

     myCss = ".state { background-color: " + bg_color + "; color: " + text_color + "; }";

    thisItem.setProperty("css",myCss);

  }

}

return this;

Hope this helps,

Brian.



Thofste - Friday, January 31, 2014 9:01 AM:

Hello Brian,

Do you also know how I can change the color of the text in cell from the selected row.

If got two columns with information but depening on the information on the back ground I want to hide the information.

I just the function above to change the text to white and the color background to white. But when I select the row the color will be the opposite so it becomes black and you can see the information in it.

Example.

Car/ Bike        Car Manual Revision  Bike Major Revision

Ford                        01                            

Giant                                                        03

BMW                       01                             01                                 selected row will show information in both fields. Because of the Major Rev.

Gazelle                                                     06     

 

I hope you could help me.

 

Kind regards,

Tom Hofste