diff --git a/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp index 5b0135bf..a5a32128 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp @@ -468,10 +468,19 @@ }); // DataTables 스크롤 이벤트 - $("#table-responsive--${pageName}").scroll(function() { + $("#table-responsive--${pageName}").scroll(function(obj) { let el = $(this); - if (el.scrollTop() == 0) return; + if (el.scrollTop() == 0) { + return; + } + + let itemsCnt = ${pageName}Control.dataset._items.length; + let totCnt = ${pageName}Control.dataset.getCurrent("item").data.TOT_CNT; + + if (itemsCnt >= totCnt) { + return; + } if ((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()) { ${pageName}Control.load(${pageName}Control.query.pageNum + 1); diff --git a/src/main/webapp/WEB-INF/jsp/fims/excl/excl02010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/excl/excl02010-main.jsp index 09c0a72f..05c9e4f6 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/excl/excl02010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/excl/excl02010-main.jsp @@ -417,6 +417,27 @@ }); } + /************************************************************************** + * + **************************************************************************/ + // DataTables에 click, dbclick 이벤트 + renderList${pageName} = () => { + let ${infoPrefix}List = ${pageName}Control.dataset; + let empty = ${infoPrefix}List.empty; + + let trs = empty ? + [document.getElementById("${infoPrefix}NotFound--${pageName}").innerHTML] : <%-- from template#${infoPrefix}NotFound --%> + ${infoPrefix}List.inStrings( + document.getElementById("${infoPrefix}Row--${pageName}").innerHTML, <%-- from template#${infoPrefix}Row --%> + (str, dataItem) => str + .replace(/{onclick}/gi, "${pageName}Control.setCurrent('" + dataItem.getValue("OPNN_ID") + "');") + .replace(/{ondblclick}/gi, "${pageName}Control.getTotalInfo('" + dataItem.getValue("CRDN_ID") + "');") + ); + + $("#tbody--${pageName}").html(trs.join()); + $("th input[type='checkbox']").prop("checked", false); + } + /************************************************************************** * 초기 셋팅 **************************************************************************/ @@ -447,33 +468,24 @@ }); // DataTables 스크롤 이벤트 - $("#table-responsive--${pageName}").scroll(function() { + $("#table-responsive--${pageName}").scroll(function(obj) { let el = $(this); - if (el.scrollTop() == 0) return; - - if ((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()) { - fnBtnSearchList${pageName}(${pageName}Control.query.pageNum + 1); + if (el.scrollTop() == 0) { + return; } - }); - } - // DataTables에 click, dbclick 이벤트 - function renderList${pageName}() { - let ${infoPrefix}List = ${pageName}Control.dataset; - let empty = ${infoPrefix}List.empty; + let itemsCnt = ${pageName}Control.dataset._items.length; + let totCnt = ${pageName}Control.dataset.getCurrent("item").data.TOT_CNT; - let trs = empty ? - [document.getElementById("${infoPrefix}NotFound--${pageName}").innerHTML] : <%-- from template#${infoPrefix}NotFound --%> - ${infoPrefix}List.inStrings( - document.getElementById("${infoPrefix}Row--${pageName}").innerHTML, <%-- from template#${infoPrefix}Row --%> - (str, dataItem) => str - .replace(/{onclick}/gi, "${pageName}Control.setCurrent('" + dataItem.getValue("OPNN_ID") + "');") - .replace(/{ondblclick}/gi, "${pageName}Control.getTotalInfo('" + dataItem.getValue("CRDN_ID") + "');") - ); + if (itemsCnt >= totCnt) { + return; + } - $("#tbody--${pageName}").html(trs.join()); - $("th input[type='checkbox']").prop("checked", false); + if ((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()) { + ${pageName}Control.load(${pageName}Control.query.pageNum + 1); + } + }); } /************************************************************************** diff --git a/src/main/webapp/WEB-INF/jsp/fims/excl/excl03010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/excl/excl03010-main.jsp index 812f6853..ea74fff6 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/excl/excl03010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/excl/excl03010-main.jsp @@ -314,9 +314,6 @@ }); } - /************************************************************************** - * - **************************************************************************/ // 저장 callback ${pageName}Control.onSave = (resp) => { if (resp.saved) @@ -334,6 +331,27 @@ }); } + /************************************************************************** + * + **************************************************************************/ + // DataTables에 click, dbclick 이벤트 + renderList${pageName} = () => { + let ${infoPrefix}List = ${pageName}Control.dataset; + let empty = ${infoPrefix}List.empty; + + let trs = empty ? + [document.getElementById("${infoPrefix}NotFound--${pageName}").innerHTML] : <%-- from template#${infoPrefix}NotFound --%> + ${infoPrefix}List.inStrings( + document.getElementById("${infoPrefix}Row--${pageName}").innerHTML, <%-- from template#${infoPrefix}Row --%> + (str, dataItem) => str + .replace(/{onclick}/gi, "${pageName}Control.setCurrent('" + dataItem.getValue("RE_REG_ID") + "');") + .replace(/{ondblclick}/gi, "${pageName}Control.getTotalInfo('" + dataItem.getValue("CRDN_ID") + "');") + ); + + $("#tbody--${pageName}").html(trs.join()); + $("th input[type='checkbox']").prop("checked", false); + } + /************************************************************************** * 초기 셋팅 **************************************************************************/ @@ -363,33 +381,24 @@ }); // DataTables 스크롤 이벤트 - $("#table-responsive--${pageName}").scroll(function() { + $("#table-responsive--${pageName}").scroll(function(obj) { let el = $(this); - if (el.scrollTop() == 0) return; - - if ((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()) { - fnBtnSearchList${pageName}(${pageName}Control.query.pageNum + 1); + if (el.scrollTop() == 0) { + return; } - }); - } - // DataTables에 click, dbclick 이벤트 - function renderList${pageName}() { - let ${infoPrefix}List = ${pageName}Control.dataset; - let empty = ${infoPrefix}List.empty; + let itemsCnt = ${pageName}Control.dataset._items.length; + let totCnt = ${pageName}Control.dataset.getCurrent("item").data.TOT_CNT; - let trs = empty ? - [document.getElementById("${infoPrefix}NotFound--${pageName}").innerHTML] : <%-- from template#${infoPrefix}NotFound --%> - ${infoPrefix}List.inStrings( - document.getElementById("${infoPrefix}Row--${pageName}").innerHTML, <%-- from template#${infoPrefix}Row --%> - (str, dataItem) => str - .replace(/{onclick}/gi, "${pageName}Control.setCurrent('" + dataItem.getValue("RE_REG_ID") + "');") - .replace(/{ondblclick}/gi, "${pageName}Control.getTotalInfo('" + dataItem.getValue("CRDN_ID") + "');") - ); + if (itemsCnt >= totCnt) { + return; + } - $("#tbody--${pageName}").html(trs.join()); - $("th input[type='checkbox']").prop("checked", false); + if ((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()) { + ${pageName}Control.load(${pageName}Control.query.pageNum + 1); + } + }); } /**************************************************************************