Skip to main content
Sep 18, 2018 10:02 AM UTC
Solved

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

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!

Oct 25, 2018 7:23 AM UTC

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

3 replies

Oct 22, 2018 10:45 AM UTC

@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-2AuthorAnswer
Oct 25, 2018 7:23 AM UTC

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

Oct 24, 2018 5:55 PM UTC

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.