Skip to content

Commit 7719fc8

Browse files
author
mariuszfoltak
committed
Fix not visible paginator
1 parent 1c50ac6 commit 7719fc8

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#Changelog
22

3+
## 0.2.5 (2016-04-19)
4+
5+
Bugfixes:
6+
7+
- fix not visible paginator
8+
39
## 0.2.4 (2016-04-19)
410

511
Bugfixes:

mf-angular2-table/package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular2-datatable",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"description": "DataTable component for Angular2 framework",
55
"main": "datatable",
66
"scripts": {
@@ -12,12 +12,10 @@
1212
"url": "git+https://github.com/mariuszfoltak/angular2-datatable.git"
1313
},
1414
"keywords": [
15-
"angular",
16-
"angularjs",
17-
"angular2",
18-
"ng",
19-
"ng2",
20-
"table"
15+
"angular", "angularjs", "angular2", "ng", "ng2",
16+
"table",
17+
"pagination",
18+
"sort", "sorting"
2119
],
2220
"author": "[email protected]",
2321
"license": "MIT",

mf-angular2-table/src/Paginator.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class Paginator implements OnInit, OnChanges {
1212
private _activePage:number;
1313
private _rowsOnPage:number;
1414

15-
public dataLength:number;
15+
public dataLength:number = 0;
1616
public lastPage:number;
1717

1818
@Input("mfTable") private inputMfTable:DataTable;
@@ -42,7 +42,8 @@ export class Paginator implements OnInit, OnChanges {
4242

4343
public ngOnInit() {
4444
let page = this.mfTable.getPage();
45-
this.onPageChangeSubscriber(page);
45+
this.dataLength = page.dataLength;
46+
this.lastPage = Math.ceil(page.dataLength / this._rowsOnPage);
4647
this.mfTable.onDataChange.subscribe(this.onDataChangeSubscriber);
4748
this.mfTable.onPageChange.subscribe(this.onPageChangeSubscriber);
4849
}

0 commit comments

Comments
 (0)