Skip to content

Commit

Permalink
Fix not visible paginator
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuszfoltak committed Apr 19, 2016
1 parent 1c50ac6 commit 7719fc8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#Changelog

## 0.2.5 (2016-04-19)

Bugfixes:

- fix not visible paginator

## 0.2.4 (2016-04-19)

Bugfixes:
Expand Down
12 changes: 5 additions & 7 deletions mf-angular2-table/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular2-datatable",
"version": "0.2.4",
"version": "0.2.5",
"description": "DataTable component for Angular2 framework",
"main": "datatable",
"scripts": {
Expand All @@ -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": "[email protected]",
"license": "MIT",
Expand Down
5 changes: 3 additions & 2 deletions mf-angular2-table/src/Paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 7719fc8

Please sign in to comment.