pagination calculated based on xml only
This commit is contained in:
parent
cc4bbabfba
commit
ac1efd90b2
|
@ -1,8 +1,13 @@
|
||||||
export class PaginationService {
|
export class PaginationService {
|
||||||
getPagination(groups, totalGroups: number, currentPage: number = 1, pageSize: number = 3) {
|
getPagination(groups, totalGroups: number, currentPage: number = 1, pageSize: number = 3) {
|
||||||
// calculate total pages
|
// calculate total pages
|
||||||
let totalPages = Math.ceil(totalGroups / pageSize);
|
//let totalPages = Math.ceil(totalGroups / pageSize);
|
||||||
|
|
||||||
|
let totalPages = 0 ; //totalpages based on pages from xml, each group and section has each one page
|
||||||
|
groups.forEach(group => {
|
||||||
|
if (group.page > totalPages)
|
||||||
|
totalPages = parseInt(group.page);
|
||||||
|
});
|
||||||
|
|
||||||
let startPage: number, endPage: number;
|
let startPage: number, endPage: number;
|
||||||
if (totalPages <= 10) {
|
if (totalPages <= 10) {
|
||||||
|
|
Loading…
Reference in New Issue