• Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

    Simple point components right aligned

    User help
    2
    6
    2536
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      posztos last edited by

      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

      1 Reply Last reply Reply Quote 0
      • M
        mlohbihler last edited by

        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>';
        
        

        Best regards,
        Matthew

        1 Reply Last reply Reply Quote 0
        • P
          posztos last edited by

          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

          1 Reply Last reply Reply Quote 0
          • M
            mlohbihler last edited by

            The variables "htmlText" and "renderedText" have been added to the script context.

            Best regards,
            Matthew

            1 Reply Last reply Reply Quote 0
            • P
              posztos last edited by

              Great, thank you!

              Regards,
              Greg

              1 Reply Last reply Reply Quote 0
              • First post
                Last post