From 60e9be5bc30cf53b4aa2ecb34c0928648791daac Mon Sep 17 00:00:00 2001 From: leebj Date: Tue, 9 Jul 2024 14:37:04 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A7=88=EC=95=BD=EB=A5=98=EC=A0=9C=ED=92=88?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=ED=8C=9D=EC=97=85=20=EC=9A=B0=EC=B8=A1?= =?UTF-8?q?=EA=B7=B8=EB=A6=AC=EB=93=9C=20=EB=AC=B4=ED=95=9C=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A1=A4=ED=8E=98=EC=9D=B4=EC=A7=95=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/jsp/adds/nims/product-popup.jsp | 53 ++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/product-popup.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/product-popup.jsp index 41ef32f..7c9d3d4 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/product-popup.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/product-popup.jsp @@ -195,8 +195,7 @@ // $P.control 설정 $P.control.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30 $P.control.untilPageNum = 0; // 현재 페이지 번호 - $P.control.beforeCurrent = null; - $P.control.tableRenderComplete = false; // dataTables 에 자료 추가 완료 여부 + $P.detailControl = new DatasetControl({ urls : { @@ -230,10 +229,9 @@ }); // $P.control 설정 - $P.detailControl.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30 + $P.detailControl.defaultFetchSize = FETCH_MD; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30 $P.detailControl.untilPageNum = 0; // 현재 페이지 번호 - $P.detailControl.beforeCurrent = null; - $P.detailControl.tableRenderComplete = false; // dataTables 에 자료 추가 완료 여부 + /************************************************************************** * DatasetControl 이벤트 @@ -252,7 +250,7 @@ , func: "pageObject['${pageName}'].control.load({index})" }); - $P.control.tableRenderComplete = true; // dataTables 에 자료 추가 완료 + }; // 현재 선택 자료 변경 이벤트 @@ -279,9 +277,8 @@ $("#tbody--${pageName}Detail").setCurrentRow(key); }; - // FIXME: 페이징 $P.detailControl.onDatasetChange = (obj, option) => { - $P.renderDetailList(obj.${infoPrefix}Total, option); + $P.renderDetailList(obj.totalCount, option); $("#${infoPrefix}DetailPaging--${pageName}").setPagingInfo({ list: $P.detailControl.dataset @@ -289,7 +286,7 @@ , totalSize: obj.totalCount }); - $P.control.tableRenderComplete = true; // dataTables 에 자료 추가 완료 + }; // 저장 callback @@ -321,17 +318,9 @@ let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").innerHTML] : ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer); - let noMore = (${infoPrefix}List.length >= totalSize); - let initScroll = ($P.control.query.pageNum < 2) && ($P.control.untilPageNum == 0); $("#tbody--${pageName}").html(trs.join()); - if ($P.control.untilPageNum != 0) { - $P.control.query.fetchSize = $P.control.defaultFetchSize; - $P.control.query.pageNum = $P.control.untilPageNum; - $P.control.untilPageNum = 0; - } - } $P.renderDetailList = (totalSize, option) => { @@ -346,8 +335,17 @@ .replace(/{onclick}/gi, "pageObject['${pageName}'].detailControl.setCurrent('" + dataItem.getValue("keyCnt") + "');") .replace(/{ondblclick}/gi, "pageObject['${pageName}'].fnSave()") ); - - $("#tbody--${pageName}Detail").html(trs.join()); + + let noMore = (${infoPrefix}DetailList.length >= totalSize); + let initScroll = ($P.detailControl.query.pageNum < 2) && ($P.detailControl.untilPageNum == 0); + + $("#table-responsive-1--${pageName}")[0].changeContent(trs.join(), initScroll, noMore); + + if ($P.detailControl.untilPageNum != 0) { + $P.detailControl.query.fetchSize = $P.detailControl.defaultFetchSize; + $P.detailControl.query.pageNum = $P.detailControl.untilPageNum; + $P.detailControl.untilPageNum = 0; + } } /************************************************************************** * 사용자 함수(function) @@ -356,7 +354,7 @@ /************************************************************************** * 버튼 clickEvent **************************************************************************/ - + //그리드(좌)조회(새로 조회) $P.fnSearchList = (dbSkipYn) => { $P.control.query = { ... $P.formFields.get(), @@ -370,8 +368,7 @@ $P.control.load(1); } - - // FIXME: 페이징처리 + //그리드(우)조회(새로 조회) $P.fnDetailSearchList = () => { $P.detailControl.query = { fg: $('#schOpt--productMain').val(), // 1-제조번호, 2-시리얼번호 @@ -394,12 +391,18 @@ }; }*/ - $P.detailControl.query.fetchSize = 100; // 한번에 조회되는 자료 건수 + $P.detailControl.query.fetchSize = FETCH_MD; // 한번에 조회되는 자료 건수 $P.detailControl.query.delYn = "N"; // 삭제 여부 $P.detailControl.load(1); } + //그리드(우)조회(스크롤) + $P.scrollDetailDataList = () => { + + $P.detailControl.query.pg = $P.detailControl.query.pageNum + 1; + $P.detailControl.load($P.detailControl.query.pageNum + 1); + } // 저장 $P.fnSave = () => { @@ -442,7 +445,9 @@ $("#btnSearch2--${pageName}").on("click", () => $P.fnSearchList("Y")); $("#btnSearch3--${pageName}").on("click", () => $P.fnDetailSearchList()); } - + + fnMakeScrollableTable($("#table-responsive-1--${pageName}")[0], $P.scrollDetailDataList); + // DataTables width 변경 조정 (업무별 그리드가 존재 한다면.. crdn06010-main.jsp 참고) // fnMakeResizableTable($("#table-responsive-0--${pageName}")[0]); // fnMakeResizableTable($("#table-responsive-1--${pageName}")[0]);