소스 검색

페이징 수정

jsshin 5 년 전
부모
커밋
e41ea8f290
2개의 변경된 파일13개의 추가작업 그리고 14개의 파일을 삭제
  1. 0 1
      src/main/java/com/style24/admin/biz/web/TsaGoodsController.java
  2. 13 13
      src/main/webapp/ux/plugins/gaga/gaga.paging.js

+ 0 - 1
src/main/java/com/style24/admin/biz/web/TsaGoodsController.java

@@ -32,7 +32,6 @@ import com.style24.admin.biz.service.TsaSystemService;
 import com.style24.admin.support.controller.TsaBaseController;
 import com.style24.admin.support.security.session.TsaSession;
 import com.style24.core.support.message.TscMessageByLocale;
-import com.style24.persistence.TsaPageRequest;
 import com.style24.persistence.domain.AdKeyword;
 import com.style24.persistence.domain.AdKeywordGoods;
 import com.style24.persistence.domain.Color;

+ 13 - 13
src/main/webapp/ux/plugins/gaga/gaga.paging.js

@@ -164,38 +164,38 @@ var gagaPaging = {
 		let pageNo = pageable.pageNo;
 		let pageSize = pageable.pageSize;
 		let pageUnit = pageable.pageUnit;
-		let totalCount = 0;
+		let totalCount = pageable.totalCount;
 
-		let firstCount = (getPageGroup()- 1) * pageable.pageUnit + 1;
+		let firstCount = (getPageGroup() - 1) * pageable.pageUnit + 1;
 		let loopCount = firstCount + pageUnit;
 		if (loopCount > getTotalPage()) {
 			loopCount = getTotalPage() + 1;
 		}
 
 		var pageTag = '';
-		if (!(firstCount === 1 && loopCount === 1)) {
-			if (getPageNo() === 1) {
+		if (!(firstCount == 1 && loopCount == 1)) {
+			if (getPageNo() == 1) {
 				pageTag += "<a class=\"arrow\" href=\"#\"><i class=\"fa fa-angle-double-left\" alt=\"맨처음\"></i></a>\n";
 			} else {
 				pageTag += "<a class=\"arrow\" href=\"#pageNo=1\"><i class=\"fa fa-angle-double-left\" alt=\"맨처음\"></i></a>\n";
 			}
 
-			if (getPageGroup() === 1) {
+			if (getPageGroup() == 1) {
 				pageTag += "<a class=\"arrow\" href=\"#\"><i class=\"fa fa-angle-left\" alt=\"이전페이지\"></i></a>\n";
 			} else {
-				pageTag += "<a class=\"arrow\" href=\"#pageNo="+(getPageGroup()-1) * pageUnit+"\"><i class=\"fa fa-angle-left\" alt=\"이전페이지\"></i></a>\n"
+				pageTag += "<a class=\"arrow\" href=\"#pageNo="+ (getPageGroup()-1) * pageUnit + "\"><i class=\"fa fa-angle-left\" alt=\"이전페이지\"></i></a>\n"
 			}
 
 			for (let i = firstCount; i < loopCount; i++) {
-				if (getPageNo() === i) {
+				if (getPageNo() == i) {
 					pageTag += "<a class=\"num on\" href=\"#\">"+ i + "</a>\n";
 				} else {
-					pageTag += "<a class=\"num\" href=\"#pageNo=" + i + "\"></a>\n"
+					pageTag += "<a class=\"num\" href=\"#pageNo=" + i + "\">" + i +"</a>\n"
 				}
 			}
 
 			if (loopCount <= (getTotalPage() + 1)) {
-				if (getPageNo() === getTotalPage()) {
+				if (getPageNo() == getTotalPage()) {
 					pageTag += "<a class=\"arrow\" href=\"#\"><i class=\"fa fa-angle-right\" alt=\"다음페이지\"></i></a>\n";
 					pageTag += "<a class=\"arrow\" href=\"#\"><i class=\"fa fa-angle-double-right\" alt=\"맨마지막\"></i></a>\n";
 				} else {
@@ -206,15 +206,15 @@ var gagaPaging = {
 		}
 
 		function getPageNo() {
-			return pageNo + 1;
+			return pageNo;
 		}
 
 		function getPageGroup() {
-			return pageNo / pageUnit + 1;
+			return parseInt(pageNo / pageUnit + 1 );
 		}
 
-		function  getTotalPage() {
-			let totalPage = totalCount / pageSize;
+		function getTotalPage() {
+			let totalPage = parseInt(totalCount / pageSize);
 			if (totalCount % pageSize > 0) {
 				totalPage++;
 			}