ngx-datatable
  • Introduction
    • Features
    • Architecture
    • Installing
    • Themeing
    • Getting Started
    • Change Detection
  • API
    • Table
      • Inputs
      • Outputs
      • Methods
      • Internals
    • Column
      • Inputs
      • Modes
      • Internals
    • Row Detail
      • Inputs
      • Outputs
    • Row
      • Custom row wrapper
  • Demos
    • Online
    • Source Code
  • Contributing
    • Building
    • Guidelines
    • Community
    • Credits
  • Changelog
Powered by GitBook
On this page
  1. Introduction

Change Detection

The table implements OnPush change detection which means the dirty checking checks for immutable data types. That means if you do object mutations like:

this.rows[i]['gender'] = 'Female';

The table will not detect a change! Instead if you do a change like this, you need to do:

this.rows[i]['gender'] = 'Female';
this.rows = [...this.rows];

This will cause the table to detect the change and update. Some might have concerns that this is a pricey operation, however, it is MUCH cheaper than running ngDoCheck and constantly diffing the array.

For more information, I recommend this article Angular Change Detection Explained.

PreviousGetting StartedNextAPI

Last updated 5 years ago