Simple point components right aligned
-
Hi,
Is there a way to be able to give the right top coordinates of a Simpe point component instead of the left top coordinates?
I'm displaying some informations in a table, where the first column consists of static labels (on background image), and the current values are displayed in the second column. The values differ in length, this is why they should be right aligned (or centered, like on Watch list).Thanks,
Greg -
Hi Greg,
This is a tricky thing, because to do this in a simple component would mean recalculating the size of the div at every update.
An alternative is to get the browser to do it for you. The catch is that you need to determine the maximum size of the component ahead of time such that you can still position it using top/left. You'd use a script component with an inner div that has a text-align of right.
return '<div style="text-align:right;width:100px;">'+ value +'</div>';
-
Hi,
Thank you for the answer.
But as I know, using a Server-side script, I can not use the different text renderers, that are used when displaying values with Simple point components. (rendering can be also coded inside the script, but it will be redundant)
Regards,
Greg -
The variables "htmlText" and "renderedText" have been added to the script context.
-
Great, thank you!
Regards,
Greg