KUIB 2.0.1 - Side Navigation

Posted by jts-law on 16-Nov-2017 16:02

Hello,

Did something change regarding how the side-navigation works between KUIB 2.0 and 2.0.1.13?  I have a navigation module that builds the side navigation for one of my modules.  I use this as the first step in controlling which views a user has access to.

After installing KUIB 2.01.13 my navigation module runs but the .view['side-navigation'] no longer exists.  The following code is in my module.run function (this isn't all code but hopefully is enough to see what I'm doing):

myNav.run(['$rootScope', '$state', '$injector', '$http',
               ($rootScope, $state, $injector, $http) => {

    console.log('myNav->run() start');
    let stateParameters = $state.get('module.default.parameters');

    if (stateParameters && stateParameters.views && stateParameters.views['side-navigation']) {
        let ttMenus = []; // This is actually populated, code is not shown here.
        let htmlMenu  = '<ul kendo-panelbar="widget">' +
                        '   <li data-state="module.default.parameters" title="Parameters">' +
                        '      <i class="fa fa-cog"></i>' +
                        '      <span>Parameters</span>' +
                        '      <ul>';
        ttMenus.forEach((menu, index) => {
            htmlMenu += '         <li class="nav-item" data-state="' +
                                    menu.dataState + '" title="' + menu.menuTitle + '">' +
                        '            <a class="k-link" ui-sref="' + menu.dataState + '">' +
                        '               <span>' + menu.menuName + '</span>' +
                        '            </a>'
                        '         </li>';
        });
        htmlMenu += '</ul></li></ul>';

        // Don't allow default menu
        stateParameters.views['side-navigation'].templateUrl = "";

        // Set template with views user has access to
        stateParameters.views['side-navigation'].template = htmlMenu;
    }

}]);

Posted by Shelley Chase on 20-Nov-2017 09:26

The side navigation view’s state is under the module.default state, so you need to have:

let stateParameters  = $state.get('module.default');

All Replies

Posted by jts-law on 16-Nov-2017 16:43

Disregard this question about something changing.  After checking a previous version, I believe the issue is due to a code change that wasn't caught right away.

Posted by Shelley Chase on 20-Nov-2017 09:26

The side navigation view’s state is under the module.default state, so you need to have:

let stateParameters  = $state.get('module.default');

This thread is closed