cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the style definition using script under particular sub-hierarchy.

ranjank
Alexandrite

Changing the style definition using script under particular sub-hierarchy.

Hi Team,

 

Suppose I have a below network hierarchy:-

 

A1(Type Apple)

    B1(Type Banana)

       C1(Type Cheeku)

       C11(Type Cheeku)

A2(Type Apple)

    B2(Type Banana)

       C2(Type Cheeku)

 

And I select node C1, then I want to change the font style of all its parents only i.e. B1 and A1 to 'Bold' and don't want to touch the styles of A2 and B2 nodes (as C1 don't belong to that sub-hierarchy).

 

What I used the approach of making all three fruit type style definitions from Composer and then updating those via script as bold, it created one issue that it updates all the Apple and Banana Type nodes (like A2 and B2) as all are having same style definition using state definition rules (rule is on Fruit Type).

 

Could somebody help me with the logic of how to update parent node styles only in particular sub-hierarchy and not in the entire network hierarchy. (on selection of every node)

 

Thanks in advance.

 

 

3 REPLIES 3

Re: Changing the style definition using script under particular sub-hierarchy.

Hi @ranjank.

 

What version of ThingWorx are you running?  Have you looked at using CSS?

 

Regards.

 

--Sharon

Re: Changing the style definition using script under particular sub-hierarchy.

@slangley 

 

The ThingWorx version is 9.1.

 

Actually, I don't have any idea about how to use Custom CSS in thingworx that's why haven't expored that way.

 

Could you please send me the logic of your approach if you have completely understood my use-case.

 

 

 

 

Re: Changing the style definition using script under particular sub-hierarchy.

Hi @ranjank.

 

I'm not an expert on CSS.  I would suggest running through the tutorial provided on the Help Center which can be found from the previous link I provided.  We also have this guide available on the Developer portal.

 

Regards.

 

--Sharon

Announcements

Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.