Page 1 of 1

How to force the highlight of a concrete pv:menu menuitem

Posted: 13 Jun 2016, 20:27
by beleta
I am using a pv:menu in the toolbar of my application.

How can I highlight the toolbar menuitem corresponding to a page, when this page has not been loaded as the result of clicking on that menuitem.

My problem is that I want to show a page after login but the highlight always is on the last clicked menuitem. Even the highlighted menuitem is remembered between server runs.

Thank you in advance.

Jose M Beleta

Re: How to force the highlight of a concrete pv:menu menuite

Posted: 14 Jun 2016, 12:14
by beleta
I forgot to say that this behavior shows up in your own demo. Enter Venture Live Preview select Documentation and close the tab. Then enter Live Preview again, the Documentation menuiten is still highlighted but your are looking at Dashboard not Documentation.

Best regards,

Jose M Beleta

Re: How to force the highlight of a concrete pv:menu menuite

Posted: 16 Jun 2016, 14:47
by mert.sincan
Thanks! I'll check and get back to you.

Re: How to force the highlight of a concrete pv:menu menuite

Posted: 22 Sep 2016, 13:30
by beleta
Any new on this topic?

Re: How to force the highlight of a concrete pv:menu menuite

Posted: 26 Oct 2016, 16:28
by mert.sincan
Please add the following line into layout.js on new venture version;

Code: Select all

...
bindTopbarMenuEvents: function() {
       ...
        
        this.clickNS = 'click.' + this.id;
        $(document.body).off(this.clickNS).on(this.clickNS, function (e) {
            if(!$this.layoutMenuClick) {
                var activeMenuParent = $this.menu.children('li.active-menu-parent');
                if($this.isPopupMenu()) {
                    $this.menuWrapper.removeClass('active');
                    activeMenuParent.children('a').removeClass('active-menu');
                }
                activeMenuParent.removeClass('active-menu-parent').children('ul').removeClass('active-menu');
                $this.menuPopupButton.removeClass('active');
                $this.menubarActive = false;
                
               /************* ADDED THIS LINE **************/

                if(!$this.isPopupMenu()) { 
                    $this.clearMenuState();
                }

               /****************************************/
            }
            
            ....
        });
    },
I'll add this fix to next release.