Skip to main content
1-Visitor
March 22, 2019
Solved

how to change color of text/background of items in list/grid dynamically?

  • March 22, 2019
  • 3 replies
  • 1873 views

hi all,

let me explain my use case,i have three list, list-A contains all the names of students in class, list-B contains names of students present and list-c contains the names of students absent. traditionally we can show two list to differentiate present students and absent students. but i want to show it in one list by color coding, have the text/background for present names as 'green' and absent names as 'red'.

 

use case.png

Best answer by PaiChung

State Based Definitions is either based on Numerical Range or based on a Match that match setup can be numerical or string.

http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx%2FHelp%2FComposer%2FVisualization%2FStyleandStateDefinitions.html

 

3 replies

22-Sapphire I
March 22, 2019

Have you tried using State Based Definitions? I think that should work.

What you can do in the service that provides the data, you can derive what 'state' a particular entry needs to be and trigger your State Based Definitions on that.

charan1-VisitorAuthor
1-Visitor
March 26, 2019

hi @PaiChung,

i am new to this platform and technology,

state based definition takes in only numeric value and i am trying to compare it with a text/string.

    

PaiChung22-Sapphire IAnswer
22-Sapphire I
March 26, 2019

State Based Definitions is either based on Numerical Range or based on a Match that match setup can be numerical or string.

http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx%2FHelp%2FComposer%2FVisualization%2FStyleandStateDefinitions.html