KUIB 2.0.1 - Side Navigation - Forum - Kendo UI Builder - Progress Community

KUIB 2.0.1 - Side Navigation

 Forum

KUIB 2.0.1 - Side Navigation

This question is answered

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

}]);
Verified Answer
  • 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
  • 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.

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

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