MenuItem "visible" properties doesn't work !!

Post Reply
benahmet
Posts: 3
Joined: 27 Nov 2020, 12:52

27 Nov 2020, 12:58

Hi,

We have PrimeNG Verona 9.0.0. We are about going live in our project. We got very curricial problem about Menu Item Visibility.

"name": "verona",
"version": "9.0.0",
"license": "PrimeNG Commercial",

Please check this issue ASAP.

Thank You
Ahmet

mert.sincan
Posts: 4569
Joined: 29 Jun 2013, 12:38

02 Dec 2020, 10:37

Hi,

Sorry for the delayed response! @merve Could you please check this issue?

Best Regards,

benahmet
Posts: 3
Joined: 27 Nov 2020, 12:52

08 Dec 2020, 09:17

Hi,

It's very urgent for us, please feed back ASAP

mert.sincan
Posts: 4569
Joined: 29 Jun 2013, 12:38

10 Dec 2020, 10:59

Hi,

We added this feature to the next version. Please make the following changes for now;

Code: Select all

//app.menuitem.component
@Component({
    /* tslint:disable:component-selector */
    selector: '[app-menuitem]',
    /* tslint:enable:component-selector */
    template: `
          <ng-container *ngIf="visible">
              ...
          </ng-container>
      `,
    host: {
        '[class.active-menuitem]': 'active'
    },
    animations: [
       ...
    ]
})
export class AppMenuitemComponent implements OnInit, OnDestroy {

    ...
    get visible():boolean {
        return this.item ? (typeof this.item.visible === "function" ? this.item.visible() : this.item.visible !== false) : false;
    }
}
Exp;

Code: Select all

...
{label: 'Form Layout', icon: 'pi pi-fw pi-id-card', routerLink: ['/uikit/formlayout'], visible: false},
{label: 'Input', icon: 'pi pi-fw pi-check-square', routerLink: ['/uikit/input']},
{label: 'Float Label', icon: 'pi pi-fw pi-bookmark', routerLink: ['/uikit/floatlabel'], visible: () => { .... return false}},
{label: 'Button', icon: 'pi pi-fw pi-mobile', routerLink: ['/uikit/button'], class: 'rotated-icon'},
...
Best Regards,

benahmet
Posts: 3
Joined: 27 Nov 2020, 12:52

14 Dec 2020, 17:27

It works.

Thank you

We are looking for new version of Verona NG.

mert.sincan
Posts: 4569
Joined: 29 Jun 2013, 12:38

15 Dec 2020, 08:32

Hi,

Yes, of course!

Best Regards,

Post Reply

Return to “Verona - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest