페이징 이전/다음 페이지 유무 수정
This commit is contained in:
parent
e12bcd15bd
commit
a3ce5ade18
@ -58,6 +58,18 @@ public class PageUtil {
|
||||
list.setNavigateLastPage(nav2[nav2.length -1]);
|
||||
}
|
||||
|
||||
// 페이지 그룹 크기 (예: 10개씩)
|
||||
int groupSize = list.getNavigatePages();
|
||||
int totalPages = list.getPages();
|
||||
|
||||
// 현재 페이지 그룹 계산
|
||||
int currentGroup = (int) Math.ceil((double) currentPage / groupSize);
|
||||
int totalGroups = (int) Math.ceil((double) totalPages / groupSize);
|
||||
|
||||
// 이전/다음 그룹 존재 여부 설정
|
||||
list.setHasPreviousPage(currentGroup > 1); // 이전 그룹 존재
|
||||
list.setHasNextPage(currentGroup < totalGroups); // 다음 그룹 존재
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user