fix : 페이징 수정

main
이범준 2 years ago
parent c1396fdc85
commit df36bc2d8c

@ -58,7 +58,12 @@ Date Author Description
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -88,7 +88,12 @@ Date Author Description
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -81,7 +81,12 @@ Date Author Description
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);
@ -136,7 +141,12 @@ Date Author Description
$2$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$2$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$2$Control._paginationInfo.totalCount = pagination.totalCount;
$2$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$2$Control._paginationInfo.totalCount = obj.count;
}
$2$Control.totalCountSetting(obj);

@ -711,7 +711,13 @@ Date Author Description
$1$Control.onDatasetChange = obj => {
if(obj.data.pagination != null){
let pagination = obj.data.pagination;
$1$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$1$Control._paginationInfo.totalCount = pagination.totalCount;
$1$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$1$Control._paginationInfo.totalCount = obj.count;
}
}
$1$Control.totalCountSetting(obj);
@ -734,7 +740,12 @@ Date Author Description
$2$Control.onDatasetChange = obj => {
if(obj.data.pagination != null) {
let pagination = obj.data.pagination;
$2$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$2$Control._paginationInfo.totalCount = pagination.totalCount;
$2$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$2$Control._paginationInfo.totalCount = obj.count;
}
}
$2$Control.totalCountSetting(obj);
@ -756,7 +767,12 @@ Date Author Description
$3$Control.onDatasetChange = obj => {
if(obj.data.pagination != null) {
let pagination = obj.data.pagination;
$3$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$3$Control._paginationInfo.totalCount = pagination.totalCount;
$3$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$3$Control._paginationInfo.totalCount = obj.count;
}
}
$3$Control.totalCountSetting(obj);
@ -778,7 +794,12 @@ Date Author Description
$4$Control.onDatasetChange = obj => {
if(obj.data.pagination != null) {
let pagination = obj.data.pagination;
$4$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$4$Control._paginationInfo.totalCount = pagination.totalCount;
$4$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$4$Control._paginationInfo.totalCount = obj.count;
}
}
$4$Control.totalCountSetting(obj);
@ -800,7 +821,12 @@ Date Author Description
$5$Control.onDatasetChange = obj => {
if(obj.data.pagination != null) {
let pagination = obj.data.pagination;
$5$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$5$Control._paginationInfo.totalCount = pagination.totalCount;
$5$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$5$Control._paginationInfo.totalCount = obj.count;
}
}
$5$Control.totalCountSetting(obj);

@ -287,7 +287,12 @@ Date Author Description
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -76,7 +76,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -72,10 +72,13 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
console.log("리턴");
console.log(obj.data.pagination);
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -87,7 +87,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -74,7 +74,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -71,7 +71,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -221,7 +221,12 @@ Date Author Description
$1$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$1$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$1$Control._paginationInfo.totalCount = pagination.totalCount;
$1$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$1$Control._paginationInfo.totalCount = obj.count;
}
$1$Control.totalCountSetting(obj);
@ -246,7 +251,12 @@ Date Author Description
$2$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$2$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$2$Control._paginationInfo.totalCount = pagination.totalCount;
$2$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$2$Control._paginationInfo.totalCount = obj.count;
}
$2$Control.totalCountSetting(obj);
@ -271,7 +281,12 @@ Date Author Description
$3$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$3$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$3$Control._paginationInfo.totalCount = pagination.totalCount;
$3$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$3$Control._paginationInfo.totalCount = obj.count;
}
$3$Control.totalCountSetting(obj);

@ -214,7 +214,12 @@ Date Author Description
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -74,7 +74,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -93,7 +93,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -68,7 +68,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -70,7 +70,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -72,7 +72,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -69,7 +69,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -71,7 +71,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -76,7 +76,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -70,7 +70,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -80,7 +80,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -72,7 +72,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -75,7 +75,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -74,7 +74,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -71,7 +71,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -71,7 +71,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -85,7 +85,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -79,7 +79,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -78,7 +78,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -62,7 +62,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -76,7 +76,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -72,7 +72,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -75,7 +75,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -80,7 +80,12 @@
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -100,7 +100,12 @@ Date Author Description
$$Control.onDatasetChange = obj => {
let pagination = obj.data.pagination;
$$Control._paginationInfo.pageNum = pagination.pageNum;
if(obj.data.pagination){
$$Control._paginationInfo.totalCount = pagination.totalCount;
$$Control._paginationInfo.pageNum = pagination.pageNum;
} else {
$$Control._paginationInfo.totalCount = obj.count;
}
$$Control.totalCountSetting(obj);

@ -14,9 +14,9 @@ class PageNavigation {
// 현재 데이타 위치
,gridDataPos: null
// 현재 page
,page: null
,pageNum: null
// 페이지당 갯수
,perPage: null
,fetchSize: null
// 전체 데이타 count
,totalCount: null
// 페이지 이동 구분
@ -31,32 +31,29 @@ class PageNavigation {
*/
constructor(GRID, gridDatas, gridDataPos) {
let pageInfo = {
page: 1,
perPage: null,
pageNum: 1,
fetchSize: null,
totalCount: null
}
};
// pageOptions type에 따라 paging 정보 위치가 달라 분기 처리
if(GRID.store.data.pageOptions.type === 'scroll'){
//const {page, perPage, totalCount} = GRID.store.data.pageOptions;
const {page, perPage, totalCount} = GRID.store.data.pageOptions;
pageInfo.page = page;
pageInfo.perPage = perPage;
if(GRID.paginationInfoRef.pagingYn === true){
const {pageNum, fetchSize, totalCount} = GRID.paginationInfoRef;
pageInfo.pageNum = pageNum;
pageInfo.fetchSize = fetchSize;
pageInfo.totalCount = totalCount;
}else{
const {itemsPerPage, totalItems} = GRID.getPagination()._options;
pageInfo.page = GRID.getPagination()._currentPage;
pageInfo.perPage = itemsPerPage;
pageInfo.totalCount = totalItems;
pageInfo.fetchSize = GRID.paginationInfoRef.totalCount;
pageInfo.totalCount = GRID.paginationInfoRef.totalCount;
}
this.gridInfo = {
gridDatas
,gridDataPos
,curRowData: gridDatas[gridDataPos]
,curRowPos: (pageInfo.page - 1) * pageInfo.perPage + gridDataPos + 1
,page: pageInfo.page
,perPage: pageInfo.perPage
,curRowPos: (pageInfo.pageNum - 1) * pageInfo.fetchSize + gridDataPos + 1
,pageNum: pageInfo.pageNum
,fetchSize: pageInfo.fetchSize
,totalCount: pageInfo.totalCount
,pageMove: null
,next: null
@ -74,7 +71,7 @@ class PageNavigation {
resetGrid(res, gridDatas, callback) {
this.grid.resetData(res.data?.contents);
if (this.gridInfo.next) this.pageNav = new PageNavigation(this.grid, gridDatas, 0);
else this.pageNav = new PageNavigation(this.grid, gridDatas, this.gridInfo.perPage - 1);
else this.pageNav = new PageNavigation(this.grid, gridDatas, this.gridInfo.fetchSize - 1);
callback(this.pageNav)
}
@ -105,15 +102,15 @@ class PageNavigation {
* @param {function} callback 페이지 이동시 호출할 callback
*/
onClickNavBtn(evDiv, callback) {
const isTypeScroll = this.grid.store?.data.pageOptions.type === 'scroll';
const isTypeScroll = this.grid.paginationInfoRef?.pagingType === 'scroll';
if (evDiv === 'next') {
if(this.gridInfo.gridDataPos + 1 === this.gridInfo.perPage){
if(this.gridInfo.gridDataPos + 1 === this.gridInfo.fetchSize){
this.gridInfo.pageMove = true;
this.gridInfo.next = true;
this.gridInfo.page++;
//isTypeScroll ? GRID.store.data.pageOptions.pageMove(this.gridInfo.page) :
if(!isTypeScroll) this.grid.getPagination()?.movePageTo(this.gridInfo.page);
this.gridInfo.pageNum++;
if(!isTypeScroll)
this.grid.getPagination()?.movePageTo(this.gridInfo.pageNum);
}else{
this.gridInfo.curRowPos++;
@ -126,9 +123,9 @@ class PageNavigation {
if(this.gridInfo.gridDataPos === 0){
this.gridInfo.pageMove = true;
this.gridInfo.next = false;
this.gridInfo.page--;
//isTypeScroll ? GRID.store.data.pageOptions.pageMove?(this.gridInfo.page) :
if(!isTypeScroll) this.grid.getPagination()?.movePageTo(this.gridInfo.page);
this.gridInfo.pageNum--;
if(!isTypeScroll)
this.grid.getPagination()?.movePageTo(this.gridInfo.pageNum);
}else {
this.gridInfo.curRowPos--;

Loading…
Cancel
Save