Get started with ng-table CDN
BSD licensed
Ng-Table is a AngularJS library for efficiently rendering large and complex data tables.
Tags:- ng-table
- table
- angularjs
Stable version
Copied!
How to start using ng-table CDN
import { Component } from '@angular/core';
import { DataSource } from 'ng-table';
@Component({
selector: 'app-ng-table-example',
template: `
<ng-table [dataSource]="dataSource" class="ng-table" [columns]="columns">
<ng-template let-dt="datasource" let-gt="getTracker" let-filter="filter">
<ag-grid-angular
class="ag-theme-balham"
[rowData]="dt.data"
[columnDefs]="columns"
(gridReady)="onGridReady($event, gt)"
(gridSizeChanged)="onGridSizeChanged($event)"
(filterChanged)="onFilterChanged($event)"
(firstDataRendered)="onFirstDataRendered($event)"
(selectionChanged)="onSelectionChanged($event)"
></ag-grid-angular>
</ng-template>
</ng-table>
`
})
export class NgTableExampleComponent {
dataSource: DataSource;
columns: any[];
constructor() {
this.columns = [
{ title: 'Name', name: 'name' },
{ title: 'Age', name: 'age' },
{ title: 'City', name: 'city' }
];
this.dataSource = new DataSource({
count: 0,
getAll: () => new Promise((resolve) => {
this.http.get('https://api.example.com/data').subscribe((data: any[]) => {
resolve(data);
});
})
});
}
onGridReady(event, getTracker) {
this.dataSource.viewChange.next();
}
onGridSizeChanged(event) {
this.dataSource.viewChange.next();
}
onFilterChanged(filter) {
filter.apply();
this.dataSource.viewChange.next();
}
onFirstDataRendered(event) {
// Handle first data rendering
}
onSelectionChanged(event) {
// Handle selection change
}
}
All versions
0.2.0
0.2.1
0.2.2
0.3.0
0.3.1
0.3.2
0.3.3
0.4.1
0.4.2
0.4.3
0.5.0
0.5.1
0.5.2
0.5.3
0.5.4
0.5.5
0.6.0
0.7.0
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
1.0.0
1.0.0-alpha
1.0.0-alpha.1
1.0.0-alpha.2
1.0.0-alpha.3
1.0.0-alpha.4
1.0.0-alpha.5
1.0.0-alpha.6
1.0.0-alpha.7
1.0.0-alpha.8
1.0.0-beta.1
1.0.0-beta.2
1.0.0-beta.3
1.0.0-beta.4
1.0.0-beta.5
1.0.0-beta.6
1.0.0-beta.7
1.0.0-beta.8
1.0.0-beta.9
2.0.0
2.0.1
2.0.2
2.1.0
2.2.0
3.0.0
3.0.1
3.1.0
*** 4.0.0