diff --git a/CHANGELOG.md b/CHANGELOG.md index f0cbc74..520617b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ #Changelog +## 0.2.5 (2016-04-19) + +Bugfixes: + + - fix not visible paginator + ## 0.2.4 (2016-04-19) Bugfixes: diff --git a/mf-angular2-table/package.json b/mf-angular2-table/package.json index 19d599d..db80805 100644 --- a/mf-angular2-table/package.json +++ b/mf-angular2-table/package.json @@ -1,6 +1,6 @@ { "name": "angular2-datatable", - "version": "0.2.4", + "version": "0.2.5", "description": "DataTable component for Angular2 framework", "main": "datatable", "scripts": { @@ -12,12 +12,10 @@ "url": "git+https://github.com/mariuszfoltak/angular2-datatable.git" }, "keywords": [ - "angular", - "angularjs", - "angular2", - "ng", - "ng2", - "table" + "angular", "angularjs", "angular2", "ng", "ng2", + "table", + "pagination", + "sort", "sorting" ], "author": "mariuszfoltak@gmail.com", "license": "MIT", diff --git a/mf-angular2-table/src/Paginator.ts b/mf-angular2-table/src/Paginator.ts index 72dff9b..94eb6b3 100644 --- a/mf-angular2-table/src/Paginator.ts +++ b/mf-angular2-table/src/Paginator.ts @@ -12,7 +12,7 @@ export class Paginator implements OnInit, OnChanges { private _activePage:number; private _rowsOnPage:number; - public dataLength:number; + public dataLength:number = 0; public lastPage:number; @Input("mfTable") private inputMfTable:DataTable; @@ -42,7 +42,8 @@ export class Paginator implements OnInit, OnChanges { public ngOnInit() { let page = this.mfTable.getPage(); - this.onPageChangeSubscriber(page); + this.dataLength = page.dataLength; + this.lastPage = Math.ceil(page.dataLength / this._rowsOnPage); this.mfTable.onDataChange.subscribe(this.onDataChangeSubscriber); this.mfTable.onPageChange.subscribe(this.onPageChangeSubscriber); }