This is a migrated thread and some comments may be shown as answers.

Kendo panelbar child item click is not working whenever I am putting routelink on Parent item.

1 Answer 281 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bikram
Top achievements
Rank 1
Bikram asked on 10 Oct 2018, 01:26 PM

Hi,

I have the below code for which all the child items are getting displayed properly in the panel bar but whenever parent route link is set the the child route is not working.But whenver there is no parent item route link only then the child item route is working.I have the requirement where both child and parent it will handle some click event.Even I have tried to use the (click) event istead of [routerLink].

<div class="panelbar-wrapper">
  <kendo-panelbar *ngIf="mainMenu">
    <kendo-panelbar-item [title]="null" *ngFor="let menuItem of dlMenu"
                        [routerLink]="menuItem.link" routerLinkActive="active" [attr.name]="menuItem.name" [class]="menuItem.label">
      <ng-template kendoPanelBarItemTitle>
        <span class="item-title">{{menuItem.title}}</span>
      </ng-template>
      <kendo-panelbar-item [title]="null" *ngFor="let menuItemSub of menuItem.sub" (click)="BackToFetchData()"
                           [routerLink]="menuItemSub.link" routerLinkActive="active" [attr.name]="menuItemSub.name" [class]="menuItemSub.label">
        <ng-template kendoPanelBarItemTitle>
          <span class="sub item-title">{{menuItemSub.title}}</span>
        </ng-template>
        <kendo-panelbar-item [title]="null" *ngFor="let menuItemSubSub of menuItemSub.sub" (click)="BackToHome()"
                             [attr.name]="menuItemSubSub.name" [class]="menuItemSubSub.label">
          <ng-template kendoPanelBarItemTitle>
            <span class="sub item-title">{{menuItemSubSub.title}}</span>
          </ng-template>
        </kendo-panelbar-item>
        </kendo-panelbar-item>
      </kendo-panelbar-item>
  </kendo-panelbar>
  </div>

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 12 Oct 2018, 12:44 PM
Hello Bikram,

Can you please describe the scenario, the exact desired functionality and the issues that you are facing in further details, e.g. are there any JavaScript errors in the browser developer tools console? Is the routing itself failing or performing the desired additional custom on-click logic?

Ideally, please send us an isolated runnable project (you can use several dummy routes and components to simulate the original application structure) so that we can gain a better understanding of the scenario and the implementation details (like how exactly are the routes composed, is there lazy loading, etc.) as well as to observe the exact issue, so we can try providing the most suitable suggestion for the specific use case. Thank you in advance.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Bikram
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or