Commit 41b1d6bcca2cfe6cc778d42899d725887699e98e
1 parent
88b2c072
Bug
Showing
3 changed files
with
8 additions
and
3 deletions
Show diff stats
src/models/statement.base.ts
| ... | ... | @@ -39,7 +39,7 @@ export abstract class StatementBase implements AfterViewInit, OnInit { |
| 39 | 39 | data = [this.createModel()]; |
| 40 | 40 | } |
| 41 | 41 | let lastRow: number = -1; |
| 42 | - if (data.length <= this.params.endRow && !this.isNew) { | |
| 42 | + if (data.length < (this.params.endRow - this.params.startRow) && !this.isNew) { | |
| 43 | 43 | lastRow = data.length; |
| 44 | 44 | } |
| 45 | 45 | this.params.successCallback(data, lastRow); |
| ... | ... | @@ -76,7 +76,12 @@ export abstract class StatementBase implements AfterViewInit, OnInit { |
| 76 | 76 | this.gridOptions.enableServerSideFilter = true; |
| 77 | 77 | this.showGrid = true; |
| 78 | 78 | this.gridOptions.rowModelType = 'virtual'; |
| 79 | - this.gridOptions.paginationPageSize = 25; | |
| 79 | + this.gridOptions.paginationPageSize = 10; | |
| 80 | + this.gridOptions.paginationOverflowSize = 2; | |
| 81 | + this.gridOptions.maxPagesInCache = 2; | |
| 82 | + this.gridOptions.getRowNodeId = function(item) { | |
| 83 | + return item.id; | |
| 84 | + }; | |
| 80 | 85 | } |
| 81 | 86 | |
| 82 | 87 | protected bootstrapGrid(): void { | ... | ... |
src/services/statement.base.service.ts
| ... | ... | @@ -29,7 +29,7 @@ export abstract class StatementBaseService { |
| 29 | 29 | sort = this.parseSort(params.sortModel[0]); |
| 30 | 30 | } |
| 31 | 31 | let url: string = this.url; |
| 32 | - url += '?from=' + params.startRow + '&to=' + params.endRow; | |
| 32 | + url += '?from=' + params.startRow + '&perPage=' + (params.endRow - params.startRow); | |
| 33 | 33 | if (sort) { |
| 34 | 34 | url += '&sort=' + sort; |
| 35 | 35 | } | ... | ... |