question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Virtual scroll causes issues with auxilary (named) routes

See original GitHub issue

I’m submitting a … (check one with “x”)

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior When virtual scroll is activated on a datatable, this breaks auxilary (named) routing.

Basically:

  • Create an aux route
  • Create a datatable with virtual scroll, and create a routerLink to the aux route inside the datatable
  • Click the link - it opens as expected
  • Scroll down a few pages
  • Click another link - note that the URL changes, but the component data never changes, and the ngOnInit hook never triggers
  • Scroll in the table - the component now loads

Static text can still load, but none of the angular hooks are triggered.

Expected behavior The aux route should load correctly, with the component initializing with the lifecycle hooks.

Reproduction of the problem Rough repro @ https://stackblitz.com/edit/angular-eevppg

What is the motivation / use case for changing the behavior? Ensuring the framework works as intended

Please tell us about your environment: Windows 10, Webstorm, yarn, Angular CLI. Also reproducible in stackblitz ( see above )

  • Table version: 0.8.x @swimlane/ngx-datatable@^11.1.7

  • Angular version: 2.0.x “@angular/core@^5.1.3” (same for other packages)

  • Browser: Chrome (latest), Edge (latest)

  • Language: [all | TypeScript X.X | ES6/7 | ES5] Typescript 2.5

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
yusijscommented, Jan 14, 2018

It seems to be related to zones. If you force the action to run within a zone, it works:

this.zone.run(() => this.navigate());

However, routerLinks etc wont work, and event emitters needs to be done within a function.

So if you did (click)=“select.emit(stuff)” You now need to do (click)=“select(stuff)” in html, and select(stuff) { this.zone.run(() => this.selectEmitter.emit(stuff)); }

Apologies for shit formatting, on mobile 😃

1reaction
Fitkullincommented, Jan 8, 2018

Bug Virtual scrollY (table 500 lines) <ngx-datatable-column name=“Name” [flexGrow]=“3” [minWidth]=“200”> <ng-template let-value="value" let-row="row" ngx-datatable-cell-template> <a class=“table-link” [routerLink]=“[‘/app’, ‘hr’, ‘employees’, row.id]”>{{row.name}} </ng-template> </ngx-datatable-column>

after scroll down routing stop working , ngOnInit hook never triggers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cdk virtual scrolling issue - angular - Stack Overflow
You need to lazy load the tab content by declaring the body in a ng-template with the matTabContent attribute. This way, the viewport...
Read more >
Most Of Your Modal Windows Should Be Directly Accessible ...
Ben Nadel posits that most modal windows within a Single-Page Application (SPA) should be directly accessible by route. With the auxiliary ...
Read more >
Intents - Digital Assistant - Oracle Help Center
Intents allow your skill to understand what the user wants it to do. An intent categorizes typical user requests by the tasks and...
Read more >
NissanConnect Support & FAQ | Nissan USA
View All FAQs · How do I pair my Bluetooth phone to my vehicle? · Can I connect multiple Bluetooth devices to my...
Read more >
MainStage release notes - Apple Support (AZ)
Fixes a issue which caused Concert level Saved Value settings not to load the correct values. The Layer Editor now displays channel strip...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found