Skip to main content
14-Alexandrite
September 18, 2018
Solved

How to reference an existing Style Definition from an Advanced Grid Configuration Service?

  • September 18, 2018
  • 2 replies
  • 1565 views

Hi!

 

I'm using a configuration script for an Advanced (Tree) Grid v4.0.2.

 

What I'd like to do is to reference an existing Style Definition from my configuration script, when setting styles' properties, rather than hard coding it. Indeed, doing so from various script ensures that you use same styles in all your grids.

In other words, technically, what I'd like to declare something like this:

 "styles": {
 "tableHeaderStyle": "MyProject.GridAdvancedHeaderStyle",

instead of something like this (hard-coded):

 

 "styles": { 
 "tableHeaderStyle": {
 "backgroundColor": "#202020",
 "secondaryBackgroundColor": "",
 "foregroundColor": "#ffffff",
 "textDecoration": "",
 "image": "url",
 "lineColor": "#c0c0c0",
 "borderStyle": "solid",
 "borderWidth": "1px",
 "fontFamily": ["helvetica", "arial"],
 "fontStyle": "normal",
 "fontSize": "11px",
 "fontWeight": "bold"
 },

Of course I've tested it ... but it does not work. It seams that existing Style Definitions can be applied to Advanced Grids using GUI, but not Configuration Services ...

 

Thanks for support!

Best answer by ssauvage-2

Yes @dupatel, it's surely a limitation.

I hope it will be lifted, as reuse of style definitions is definitively a good practice to ensure homogeneous rendering in the application.

Thanks

2 replies

5-Regular Member
October 22, 2018

@ssauvage-2 For Style Definition, i believe this is the limitation at the moment and as pointed out we need to use UI to update definitions.

 

-Durgesh

ssauvage-214-AlexandriteAuthorAnswer
14-Alexandrite
October 25, 2018

Yes @dupatel, it's surely a limitation.

I hope it will be lifted, as reuse of style definitions is definitively a good practice to ensure homogeneous rendering in the application.

Thanks

22-Sapphire I
October 24, 2018

In the current version of Thingworx you should be able to use the CSS on the mashup to apply it.

You will have to know the DOM and Elements etc.