Ngx-datatable: using 6.3.0 switching between pages very slow

Created on 5 Apr 2017  路  5Comments  路  Source: swimlane/ngx-datatable

I'm submitting a ...

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

Current behavior
when switching between pages of the datatable with multiple page, theres a big delay.
Was this a problem before? Could it be the version of angular?

  • Table version: 0.7.x
    6.3.0

  • Angular version: 2.0.x
    2.4.0

  • Browser: [all ]

  • Language: [TypeScript ]

Most helpful comment

A few quick questions to narrow this down:

  1. Is your app running in production mode?
  2. Does your grid have a large number of columns?

All 5 comments

A few quick questions to narrow this down:

  1. Is your app running in production mode?
  2. Does your grid have a large number of columns?

@adammedford just tried it production... its like a different world. ye, its very smooth in prod, closing this. Thanks :)

Glad it worked out for you. Something to keep in mind though:

Outside of production mode Angular 2 has a lot of redundant logic that second guesses your application's logic to try and uncover unintended side-effects. As a result, you shouldn't be developing in Production mode with this datatable just because it makes things run smoother because Angular's debug mode checks are ultimately there to help you.

To give you an example of what this will catch:
Say you've got a component that outputs an event every time some property changes. Your app (for the purposes of this example) listens to that event and inputs the new value to the same component that emitted it. What's next? That component emits an event signaling that value has changed - triggering an infinite loop. It seems like a contrived scenario but its an easy mistake to make. In debug mode Angular will notice this value changed between change detection runs and throw a fatal error so you know exactly where to look. In production mode, there is no telling how long you'd spend trying to get the same information.

The main cause is ng-reflect
In Angular2, I set useDebug: false to disabled it.
However, in Angular4 that's deprecated: https://github.com/angular/angular/issues/9707#issuecomment-289046682

So not sure how to turn-off ng-reflect anymore.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthewbrozen picture matthewbrozen  路  27Comments

BotanMan picture BotanMan  路  40Comments

manishsharma1992 picture manishsharma1992  路  39Comments

Codermar picture Codermar  路  37Comments

pdfarhad picture pdfarhad  路  40Comments