Skip to main content
12-Amethyst
May 9, 2022
Solved

Grid Configuration - Row Based State Definition

  • May 9, 2022
  • 1 reply
  • 1475 views

Anyone have success setting up row based state definitions using a grid configuration? 

 

Below is a code snippet of my configuration. I have checked that the column "fieldName" matches the field name below, values in my table the states "value", and that I am able to apply general styling to the grid. (see the commented out style).  Any ideas on what else could be going on?

 

 

 "rows": {
 "selection": "single",
 "defaultSelectedRows": "",
 "minHeight": "30",
 "autoScroll": true, 
 "rowFormatter": { 
 "stateDefinition": { 
 "name": "Entry Difference Indicator",
 "fieldName": "entryDifferenceIndicator",
 "type": "not-fixed",
 "states": [ 
 {
 "name": "Different Entries", 
 "value": "noEquivalentEntry",
 "comparator": "==", 
 "styleName": "rowFormatterStyle" 
 }
 ]
 }
 }
 },
 "styles": {
 "rowFormatterStyle": {
 "backgroundColor": "blue",
 "fontWeight": "bold"
 },
 /*"rowBackgroundStyle": {
 "backgroundColor": "blue",
 },*/
 }

 

Best answer by travman7777

Hi Sharon,

 

I ended up copying and pasting code from the service "GetEmployeeConfiguration" on the GridAdvancedExampleServices thing found from the link below, and inserting code specific to my project.  Most likely some typo in my code that I could not find.

 

https://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/index.html#page/ThingWorx/Help/Mashup_Builder/Widgets/AdvancedGridsSamplesFile.html#wwID0ECAX5

1 reply

Community Manager
May 11, 2022

Hi @travman7777 

 

Can you provide more details on the issue?  What are you trying to do that isn't working as expected?  If you can send some screenshots showing what you want vs. what you are seeing would be helpful.

 

Regards.

 

--Sharon

travman777712-AmethystAuthorAnswer
12-Amethyst
May 11, 2022

Hi Sharon,

 

I ended up copying and pasting code from the service "GetEmployeeConfiguration" on the GridAdvancedExampleServices thing found from the link below, and inserting code specific to my project.  Most likely some typo in my code that I could not find.

 

https://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/index.html#page/ThingWorx/Help/Mashup_Builder/Widgets/AdvancedGridsSamplesFile.html#wwID0ECAX5