• 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

    Changing the standard charts in the angular JS

    Dashboard Designer & Custom AngularJS Pages
    3
    21
    10.8k
    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.
    • A
      atkins.chrisw
      last edited by

      I'm still using the adminTemplate. I am trying to understand better the new msAdmin and how to recreate our website with it.

      1 Reply Last reply Reply Quote 0
      • Will GellerW
        Will Geller
        last edited by Will Geller

        Using the adminTemplate you will want to add a Page to the MENU_ITEMS array in app.js but you will want to set its menuHidden property to true.

        For example this is the errors Page definition:

        {
                name: 'dashboard.apiErrors',
                url: '/api-errors',
                templateUrl: 'views/dashboard/errors.html',
                menuTr: 'dashboards.v3.dox.apiErrors',
                menuIcon: 'warning',
                menuHidden: true
            }
        

        So you would want to do this for the custom page you have created. You will still need a url, template, state name, and menuTr or menuText (as it is used in the breadcrumbs header on the page when viewed.

        and then you can link to them via the state name and ui-sref property on a link:
        eg:

        <a ui-sref="dashboard.apiErrors" class="md-mangoDefault-theme"><md-icon class="md-mangoDefault-theme material-icons">warning</md-icon></a>
        

        or simply the href set by the url property:

         <a href="/dashboards/api-errors" class="md-mangoDefault-theme"><md-icon class="md-mangoDefault-theme material-icons">warning</md-icon></a>
        

        Infinite Automation - UI Developer

        1 Reply Last reply Reply Quote 0
        • A
          atkins.chrisw
          last edited by

          I am getting this error:

          angular.js:118 Error: Could not resolve 'dashboard.cooling' from state 'dashboard.section1.page1'
          at Object.y.transitionTo (angular-ui-router.js:7)
          at Object.y.go (angular-ui-router.js:7)
          at angular-ui-router.js:7
          at angular.js:158
          at e (angular.js:45)
          at angular.js:48

          1 Reply Last reply Reply Quote 0
          • Jared WiltshireJ
            Jared Wiltshire
            last edited by

            When are you getting the error? Please post up the URL you are trying to navigate to and/or the HTML code for your link.
            Please also post the contents of your app.js file.

            We cannot even begin to start guessing why you are getting that error without knowing more details.
            Can you please try and explain the context of your errors more completely when you are asking questions. It will make it a lot faster and easier for us to help you out.

            Developer at Radix IoT

            1 Reply Last reply Reply Quote 0
            • A
              atkins.chrisw
              last edited by

              Sorry Jared. You are right. I am getting an error opening a custom page from a button click on one of my pages.

              Here is my app.js file.
              0_1472833196236_apps.js

              Here is my HTML code for the page where I am using a button to go to a custom page.
              0_1472833228093_page1.html

              I added the custom pages into the views/dashboards/ file
              For quick reference, here is a snippet of the app.js file

              // define our pages, these are added to the $stateProvider in the config block below
              myAdminApp.constant('PAGES', [
              {
              state: 'dashboard',
              url: '/dashboard',
              templateUrl: 'views/dashboard/main.html',
              resolve: {
              auth: ['$rootScope', 'User', function($rootScope, User) {
              // retrieves the current user when we navigate to a dashboard page
              // if an error occurs the $stateChangeError listener redirects to the login page
              $rootScope.user = User.current();
              return $rootScope.user.$promise;
              }],
              dashboardTranslations: ['Translate', function(Translate) {
              // load any translation namespaces you want to use in your app up-front
              // so they can be used by the 'tr' filter
              return Translate.loadNamespaces(['dashboards']);
              }]
              }
              },
              {
              state: 'login',
              url: '/login',
              templateUrl: 'views/login.html',
              resolve: {
              loginTranslations: ['Translate', function(Translate) {
              return Translate.loadNamespaces('login');
              }]
              }
              },
              {
              state: 'dashboard.home',
              url: '/home',
              templateUrl: 'views/dashboard/home.html',
              menuTr: 'dashboards.v3.dox.home',
              //menuIcon: 'fa fa-home', // font awesome css classes for icon
              menuType: 'link'
              },
              {
              state: 'dashboard.apiErrors',
              url: '/api-errors',
              templateUrl: 'views/dashboard/errors.html',
              menuTr: 'dashboards.v3.dox.apiErrors'
              },
              {
              state: 'dashboard.power',
              url: '/power',
              templateUrl: 'views/dashboard/power.html',
              // menuTr: 'dashboards.v3.dox.power'
              menuhidden: true
              },
              {
              state: 'dashboard.heating',
              url: '/gas',
              templateUrl: 'views/dashboard/heating.html',
              // menuTr: 'dashboards.v3.dox.gas'
              menuhidden: true
              },
              {
              state: 'dashboard.cooling',
              url: '/power',
              templateUrl: 'views/dashboard/cooling.html',
              // menuTr: 'dashboards.v3.dox.cooling'
              menuhidden: true
              },
              {
              state: 'dashboard.water',
              url: '/water',
              templateUrl: 'views/dashboard/water.html',
              // menuTr: 'dashboards.v3.dox.water'
              menuhidden: true
              },

              1 Reply Last reply Reply Quote 0
              • Jared WiltshireJ
                Jared Wiltshire
                last edited by

                OK I think that your problem is that you have the same url in both state dashboard.power and dashboard.cooling.
                Also your menu items won't be hidden as the property name is menuHidden not menuhidden (should have a capital H).

                Developer at Radix IoT

                1 Reply Last reply Reply Quote 0
                • A
                  atkins.chrisw
                  last edited by

                  OK. I have fixed those items. It is still giving me that error.

                  Jared WiltshireJ 1 Reply Last reply Reply Quote 0
                  • Jared WiltshireJ
                    Jared Wiltshire @atkins.chrisw
                    last edited by

                    @atkins.chrisw
                    Have you cleared your browser cache?

                    Developer at Radix IoT

                    1 Reply Last reply Reply Quote 0
                    • A
                      atkins.chrisw
                      last edited by

                      Yes. Whats weird is that the Home button works. It will send me back home.

                      1 Reply Last reply Reply Quote 0
                      • A
                        atkins.chrisw
                        last edited by

                        I reloaded all of my files in my server and it is now working.

                        Thanks again Jared. Sorry I keep being a pain

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