• Recent
    • Tags
    • Popular
    • Register
    • Login

    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 Mango 5 Documentation Website

    Change the order of Graphic View screens

    User help
    3
    5
    1.6k
    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.
    • M
      Matias Saul
      last edited by Matias Saul

      Hi,

      I need to change the order (or the viewID) of my screens in Graphic View module. I use Mango 2.7.2.

      Is there any way to do this? I remember, in previous versions, if I made any change on a specific screen, it was saved in the first position...

      Thanks in advance!

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        Hmm. It's not particularly easy, but I think it is possible.

        One way would be to export a view, delete it, and then this would move it to the bottom of the list.

        An easier option is to modify Mango/web/modules/graphicalViews/web/views.jsp and adding something like this before the closing </tag:page>

        //Code taken from googling "sort option elements javascript"
        // but adapted for $ meaning dojo
        var newOptions = jQuery(".borderDiv select option").sort(function(a,b){
        	  if (a.text.toUpperCase() > b.text.toUpperCase()) return 1;
        	  else if (a.text.toUpperCase() < b.text.toUpperCase()) return -1;
        	  else return 0;
        });
        jQuery(".borderDiv select").empty().append(newOptions);
        
        1 Reply Last reply Reply Quote 0
        • G
          gbodacs
          last edited by

          Hi Phil!

          I did what you suggested, I added the code to the end of the file. It works correctly, the views are in alphabetic order now.
          However, the view-selector drop-down menu works incorrectly. The selected view is not the view I can see on the webpage (but the last one). The result is that I cannot select the last view, because the list "thinks" that this is selected already.

          Could you please fix this for me?
          Thank you!

          1 Reply Last reply Reply Quote 0
          • phildunlapP
            phildunlap
            last edited by phildunlap

            Hi gbodacs,

            Change

            jQuery(".borderDiv select").empty().append(newOptions);
            

            to

            jQuery(".borderDiv select").empty().append(newOptions).val("<c:out value="${currentView.id}"/>");
            
            1 Reply Last reply Reply Quote 0
            • G
              gbodacs
              last edited by

              Thank you, it works in my sandbox Mango environment! :) You just saved me 4 hours of exporting-textediting-deleting-importing-testing nightmare!

              Thanks again!

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