This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing colour of dashboard text fields based on value
#8
(2017-08-12, 12:34 AM)JD1 Wrote: I have been able to experiment a bit with this but am running into more problems which are probably general concept issues.
The template node has an input and an output. I can use the template node to put 'stuff' into the assigned group. This 'stuff' could be a coloured data value and presumably a description which would imitate a text node. Up until now I put the template node prior to a text node in the flow but if I understand things right the template node actually replaces the text node? If that is so, why is there an output to the template node - what is it used for ?
Last but not least, the text node has a 'value format' field that allows for angular and HTML expressions - is it possible to cram the entire HTML code given here as an example into that little field and have the value portion of the text node displayed in colour ?

I have never used angularjs before. The whole dashboard is built in it and its not very pleasant to debug the javascript and html. Besides that imho the dashboard is poorly documented. All i know is javascript, css and html and that the template node lets you inject all of this into the dashboard. My 'solution' isn't easy to customize, without the basic knowledge of this stuff. I just wanted to give you an idea of how it can be done.
In my template node a html layer is created (<div></div>). It has  specific attributes like the id so I can easy find it with javascript. I've created a random number and stored it in msg.rand. Angular updates the content of the div every time a msg object is passed to the template node. The javscriptcode in the <script></script> block gets msg.rand from angularjs and checks its value. If there is a certain value the font-color of the div is set via css by javascript.

I hope this isn't too much confusing Smile

So like you said the template node replaces the text node. I don't know why there is an output on the template-node. It just passes the msg object through.
I do not know either if the colouring of certain values can be done with angular js inside the text-node.
Reply


Messages In This Thread
RE: Changing colour of dashboard text fields based on value - by shark24 - 2017-08-12, 09:14 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)