스크롤링 처리 방식 변경

main
이범준 12 months ago
parent 9372ab082d
commit 62c4fa0013

@ -650,23 +650,6 @@ $(document).ready(function(){
$P.sameVehicleControl.sub.load(0); $P.sameVehicleControl.sub.load(0);
} }
$P.scrollEnd = (obj) => {
if(obj.dataset.scrollStatus){
return;
}
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
obj.dataset.scrollStatus = "waiting";
$P.scrollInspectionDataList();
}
}
$P.scrollInspectionDataList = () => { $P.scrollInspectionDataList = () => {
switch ($P.currentDisplay) { switch ($P.currentDisplay) {
case "photoInspection": case "photoInspection":
@ -885,14 +868,12 @@ $(document).ready(function(){
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');");
var trs = empty ? notFound : dataList.inStrings(found, replacer); var trs = empty ? notFound : dataList.inStrings(found, replacer);
$("#photoInspectionTbody--${pageName}").html(trs.join()); var noMore = (total == dataList.length);
var initScroll = ($P.photoInspectionControl.query.pageNum < 2) && ($P.photoInspectionControl.untilPageNum == 0);
if(total == dataList.length){ $("#photoInspection-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
$("#photoInspection-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#photoInspection-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.photoInspectionControl.untilPageNum != 0){ if($P.photoInspectionControl.untilPageNum != 0){
$P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize; $P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize;
@ -907,14 +888,13 @@ $(document).ready(function(){
var found = document.getElementById("sameVehicleInspectionMainRow--${pageName}").innerHTML; var found = document.getElementById("sameVehicleInspectionMainRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID_LIST") + "','sameVehicleInspectionMain');"); .replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID_LIST") + "','sameVehicleInspectionMain');");
var trs = empty ? notFound : dataList.inStrings(found, replacer); var trs = empty ? notFound : dataList.inStrings(found, replacer);
$("#sameVehicleInspectionMainTbody--${pageName}").html(trs.join()); var noMore = (total == dataList.length);
var initScroll = ($P.sameVehicleControl.main.query.pageNum < 2) && ($P.sameVehicleControl.untilPageNum == 0);
$("#sameVehicleInspectionMain-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
if(total == dataList.length){
$("#sameVehicleInspectionMain-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#sameVehicleInspectionMain-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.sameVehicleControl.untilPageNum != 0){ if($P.sameVehicleControl.untilPageNum != 0){
$P.sameVehicleControl.main.query.fetchSize = $P.sameVehicleControl.defaultFetchSize; $P.sameVehicleControl.main.query.fetchSize = $P.sameVehicleControl.defaultFetchSize;
@ -979,9 +959,10 @@ $(document).ready(function(){
$("#btnInstLevyExcl--${pageName}").on("click", () => $P.openLevyExclPop("1")); $("#btnInstLevyExcl--${pageName}").on("click", () => $P.openLevyExclPop("1"));
//스크롤 이벤트 추가(동일차량검사) //스크롤 테이블
$("#photoInspection-responsive--${pageName}").on("scrollend", function(){ $P.scrollEnd(this); }); fnMakeScrollableTable($("#photoInspection-responsive--${pageName}")[0], $P.scrollInspectionDataList);
$("#sameVehicleInspectionMain-responsive--${pageName}").on("scrollend", function(){ $P.scrollEnd(this); }); fnMakeScrollableTable($("#sameVehicleInspectionMain-responsive--${pageName}")[0], $P.scrollInspectionDataList);
$("#photoInspection_Table_0--${pageName}").find("th").resizable({handles : "e"}); $("#photoInspection_Table_0--${pageName}").find("th").resizable({handles : "e"});
$("#sameVehicleInspectionMain_Table_0--${pageName}").find("th").resizable({handles : "e"}); $("#sameVehicleInspectionMain_Table_0--${pageName}").find("th").resizable({handles : "e"});
$("#sameVehicleInspectionSub_Table_0--${pageName}").find("th").resizable({handles : "e"}); $("#sameVehicleInspectionSub_Table_0--${pageName}").find("th").resizable({handles : "e"});

@ -205,23 +205,6 @@ $(document).ready(function(){
$P.crdnControl.load(1); $P.crdnControl.load(1);
} }
$P.scrollEnd = (obj) => {
if(obj.dataset.scrollStatus){
return;
}
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
obj.dataset.scrollStatus = "waiting";
$P.scrollCrdnList();
}
}
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
@ -271,16 +254,14 @@ $(document).ready(function(){
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
var trs = empty ? notFound : crdnList.inStrings(found,replacer); var trs = empty ? notFound : crdnList.inStrings(found,replacer);
$("#crdnTbody--${pageName}").html(trs.join()); var noMore = (total == crdnList.length);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.crdnControl.untilPageNum != 0){ if($P.crdnControl.untilPageNum != 0){
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize; $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
@ -317,7 +298,9 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$("#table-responsive--${pageName}").on("scrollend", function(){ $P.scrollEnd(this); });
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollCrdnList);
$('#btnUpdateToConfirmData--${pageName}').on('click', () => { $('#btnUpdateToConfirmData--${pageName}').on('click', () => {
if(!$P.crdnControl.getCurrent()) { if(!$P.crdnControl.getCurrent()) {

@ -243,23 +243,6 @@ $(document).ready(function(){
$P.crdnControl.load(1); $P.crdnControl.load(1);
} }
$P.scrollEnd = (obj) => {
if(obj.dataset.scrollStatus){
return;
}
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
obj.dataset.scrollStatus = "waiting";
$P.scrollCrdnList();
}
}
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
@ -286,18 +269,14 @@ $(document).ready(function(){
.replace(/{ondblclick}/gi, ""); .replace(/{ondblclick}/gi, "");
var trs = empty ? notFound : crdnList.inStrings(found,replacer); var trs = empty ? notFound : crdnList.inStrings(found,replacer);
var noMore = (total == crdnList.length);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
$("#crdnTbody--${pageName}").html(trs.join()); $("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.crdnControl.untilPageNum != 0){ if($P.crdnControl.untilPageNum != 0){
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize; $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
$P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum; $P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum;
@ -320,7 +299,8 @@ $(document).ready(function(){
$("#btnInsertByFile--${pageName}").on('click', () => { $P.crdnControl.newInfo("file"); }); $("#btnInsertByFile--${pageName}").on('click', () => { $P.crdnControl.newInfo("file"); });
$("#btnInsertByHand--${pageName}").on('click', () => { $P.crdnControl.newInfo("hand"); }); $("#btnInsertByHand--${pageName}").on('click', () => { $P.crdnControl.newInfo("hand"); });
$("#table-responsive--${pageName}").on("scrollend", function(){ $P.scrollEnd(this); }); fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollCrdnList);
$("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"}); $("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"});
/************************************************************************** /**************************************************************************

@ -383,23 +383,6 @@ $(document).ready(function(){
$P.crdnControl.load(1); $P.crdnControl.load(1);
} }
$P.scrollEnd = (obj) => {
if(obj.dataset.scrollStatus){
return;
}
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
obj.dataset.scrollStatus = "waiting";
$P.scrollCrdnList();
}
}
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
@ -457,16 +440,14 @@ $(document).ready(function(){
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
var trs = empty ? notFound : crdnList.inStrings(found, replacer); var trs = empty ? notFound : crdnList.inStrings(found, replacer);
$("#crdnTbody--${pageName}").html(trs.join()); var noMore = (total == crdnList.length);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드 $("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
if(total == crdnList.length){ fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.crdnControl.untilPageNum != 0){ if($P.crdnControl.untilPageNum != 0){
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize; $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
@ -489,7 +470,7 @@ $(document).ready(function(){
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$("#table-responsive--${pageName}").on("scrollend", function(){ $P.scrollEnd(this); }); fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollCrdnList);
/************************************************************************** /**************************************************************************
* 초기화 * 초기화

@ -300,23 +300,6 @@ $(document).ready(function(){
$P.exmptnVhclControl.load(1); $P.exmptnVhclControl.load(1);
} }
$P.scrollEnd = (obj) => {
if(obj.dataset.scrollStatus){
return;
}
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
obj.dataset.scrollStatus = "waiting";
$P.scrollExmptnVhclList();
}
}
$P.scrollExmptnVhclList = () => { $P.scrollExmptnVhclList = () => {
$P.exmptnVhclControl.load($P.exmptnVhclControl.query.pageNum + 1); $P.exmptnVhclControl.load($P.exmptnVhclControl.query.pageNum + 1);
} }
@ -365,18 +348,14 @@ $(document).ready(function(){
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickExmptnVhclList('" + dataItem.getValue("EXMPTN_VHCL_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickExmptnVhclList('" + dataItem.getValue("EXMPTN_VHCL_ID") + "');");
var trs = empty ? notFound : exmptnVhclList.inStrings(found,replacer); var trs = empty ? notFound : exmptnVhclList.inStrings(found,replacer);
var noMore = (total == exmptnVhclList.length);
var initScroll = ($P.exmptnVhclControl.query.pageNum < 2) && ($P.exmptnVhclControl.untilPageNum == 0);
$("#exmptnVhclTbody--${pageName}").html(trs.join()); $("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
if(total == exmptnVhclList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.exmptnVhclControl.untilPageNum != 0){ if($P.exmptnVhclControl.untilPageNum != 0){
$P.exmptnVhclControl.query.fetchSize = $P.exmptnVhclControl.defaultFetchSize; $P.exmptnVhclControl.query.fetchSize = $P.exmptnVhclControl.defaultFetchSize;
$P.exmptnVhclControl.query.pageNum = $P.exmptnVhclControl.untilPageNum; $P.exmptnVhclControl.query.pageNum = $P.exmptnVhclControl.untilPageNum;
@ -461,7 +440,8 @@ $(document).ready(function(){
$("#btnOpenDelRsn--${pageName}").on('click', () => { $P.fnOpenDelRsnDialog(); }); $("#btnOpenDelRsn--${pageName}").on('click', () => { $P.fnOpenDelRsnDialog(); });
$("#btnHistory--${pageName}").on('click', () => { $P.fnOpenHistory(); }); $("#btnHistory--${pageName}").on('click', () => { $P.fnOpenHistory(); });
$("#table-responsive--${pageName}").on("scrollend", function(){ $P.scrollEnd(this); }); fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollExmptnVhclList);
$("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"}); $("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"});
/************************************************************************** /**************************************************************************

@ -361,23 +361,6 @@ $(document).ready(function(){
$P.crdnControl.load(1); $P.crdnControl.load(1);
} }
$P.scrollEnd = (obj) => {
if(obj.dataset.scrollStatus){
return;
}
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
obj.dataset.scrollStatus = "waiting";
$P.scrollCrdnList();
}
}
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
@ -463,17 +446,16 @@ $(document).ready(function(){
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
var trs = empty ? notFound : crdnList.inStrings(found, replacer); var trs = empty ? notFound : crdnList.inStrings(found, replacer);
$("#crdnTbody--${pageName}").html(trs.join()); var noMore = (total == crdnList.length);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.crdnControl.untilPageNum != 0){ if($P.crdnControl.untilPageNum != 0){
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize; $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
@ -644,7 +626,8 @@ $(document).ready(function(){
$("#btnDeleteSameRcptYmd--${pageName}").on("click", () => $P.fnRemoveSameRcptYmd()); $("#btnDeleteSameRcptYmd--${pageName}").on("click", () => $P.fnRemoveSameRcptYmd());
$("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl()); $("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl());
$("#table-responsive--${pageName}").on("scrollend", function(){ $P.scrollEnd(this); }); fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollCrdnList);
$("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"}); $("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"});
/************************************************************************** /**************************************************************************

@ -387,23 +387,6 @@ $(document).ready(function(){
$P.crdnControl.load(1); $P.crdnControl.load(1);
} }
$P.scrollEnd = (obj) => {
if(obj.dataset.scrollStatus){
return;
}
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
obj.dataset.scrollStatus = "waiting";
$P.scrollCrdnList();
}
}
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
@ -450,18 +433,16 @@ $(document).ready(function(){
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
var trs = empty ? notFound : crdnList.inStrings(found, replacer); var trs = empty ? notFound : crdnList.inStrings(found, replacer);
$("#crdnTbody--${pageName}").html(trs.join()); var noMore = (total == crdnList.length);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.crdnControl.untilPageNum != 0){ if($P.crdnControl.untilPageNum != 0){
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize; $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
$P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum; $P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum;
@ -673,7 +654,8 @@ $(document).ready(function(){
$("#btnExecuteAnswer--${pageName}").on("click", () => $P.fnExecuteAnswer()); $("#btnExecuteAnswer--${pageName}").on("click", () => $P.fnExecuteAnswer());
$("#btnAnswerComplete--${pageName}").on("click", () => $P.fnAnswerComplete()); $("#btnAnswerComplete--${pageName}").on("click", () => $P.fnAnswerComplete());
$("#table-responsive--${pageName}").on("scrollend", function(){ $P.scrollEnd(this); }); fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollCrdnList);
$("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"}); $("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"});
/************************************************************************** /**************************************************************************

@ -348,23 +348,6 @@ $(document).ready(function(){
$P.crdnControl.load(1); $P.crdnControl.load(1);
} }
$P.scrollEnd = (obj) => {
if(obj.dataset.scrollStatus){
return;
}
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
obj.dataset.scrollStatus = "waiting";
$P.scrollCrdnList();
}
}
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
@ -417,18 +400,16 @@ $(document).ready(function(){
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
var trs = empty ? notFound : crdnList.inStrings(found, replacer); var trs = empty ? notFound : crdnList.inStrings(found, replacer);
$("#crdnTbody--${pageName}").html(trs.join()); var noMore = (total == crdnList.length);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.crdnControl.untilPageNum != 0){ if($P.crdnControl.untilPageNum != 0){
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize; $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
$P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum; $P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum;
@ -547,7 +528,8 @@ $(document).ready(function(){
$("#btnDelete--${pageName}").on("click", () => $P.fnRemove()); $("#btnDelete--${pageName}").on("click", () => $P.fnRemove());
$("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl()); $("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl());
$("#table-responsive--${pageName}").on("scrollend", function(){ $P.scrollEnd(this); }); fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollCrdnList);
$("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"}); $("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"});
/************************************************************************** /**************************************************************************

@ -297,22 +297,6 @@ $(document).ready(function(){
$P.dmndControl.load(1); $P.dmndControl.load(1);
} }
$P.scrollEnd = (obj) => {
if(obj.dataset.scrollStatus){
return;
}
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
obj.dataset.scrollStatus = "waiting";
$P.scrollDmndList();
}
}
$P.scrollDmndList = () => { $P.scrollDmndList = () => {
$P.dmndControl.load($P.dmndControl.query.pageNum + 1); $P.dmndControl.load($P.dmndControl.query.pageNum + 1);
} }
@ -342,14 +326,12 @@ $(document).ready(function(){
var found = document.getElementById("dmndRow--${pageName}").innerHTML; var found = document.getElementById("dmndRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickDmndList('" + dataItem.getValue("INDIV_ID") + "');"); .replace(/{onclick}/gi, "pageObject['${pageName}'].clickDmndList('" + dataItem.getValue("INDIV_ID") + "');");
var trs = empty ? notFound : dmndList.inStrings(found, replacer); var trs = empty ? notFound : dmndList.inStrings(found, replacer);
$("#dmndTbody--${pageName}").html(trs.join()); var noMore = (total == dmndList.length);
var initScroll = ($P.dmndControl.query.pageNum < 2) && ($P.dmndControl.untilPageNum == 0);
if(total == dmndList.length){ $("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.dmndControl.untilPageNum != 0){ if($P.dmndControl.untilPageNum != 0){
$P.dmndControl.query.fetchSize = $P.dmndControl.defaultFetchSize; $P.dmndControl.query.fetchSize = $P.dmndControl.defaultFetchSize;
@ -461,7 +443,8 @@ $(document).ready(function(){
$("#btnDelete--${pageName}").on("click", () => $P.fnRemove(null)); $("#btnDelete--${pageName}").on("click", () => $P.fnRemove(null));
$("#btnDeleteAllCompleteData--${pageName}").on("click", () => $P.fnRemoveAllCompleteData()); $("#btnDeleteAllCompleteData--${pageName}").on("click", () => $P.fnRemoveAllCompleteData());
$("#table-responsive--${pageName}").on("scrollend", function(){ $P.scrollEnd(this); }); fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDmndList);
$("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"}); $("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"});
/************************************************************************** /**************************************************************************

@ -244,23 +244,6 @@ $(document).ready(function(){
$P.rductControl.load(1); $P.rductControl.load(1);
} }
$P.scrollEnd = (obj) => {
if(obj.dataset.scrollStatus){
return;
}
var el = $(obj);
if(el.scrollTop() == 0){
return;
}
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
obj.dataset.scrollStatus = "waiting";
$P.scrollRductList();
}
}
$P.scrollRductList = () => { $P.scrollRductList = () => {
$P.rductControl.load($P.rductControl.query.pageNum + 1); $P.rductControl.load($P.rductControl.query.pageNum + 1);
} }
@ -308,17 +291,15 @@ $(document).ready(function(){
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickRductList('" + dataItem.getValue("CRDN_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickRductList('" + dataItem.getValue("CRDN_ID") + "');");
var trs = empty ? notFound : rductList.inStrings(found,replacer); var trs = empty ? notFound : rductList.inStrings(found,replacer);
var noMore = (total == rductList.length);
var initScroll = ($P.rductControl.query.pageNum < 2) && ($P.rductControl.untilPageNum == 0);
$("#rductTbody--${pageName}").html(trs.join()); $("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
if(total == rductList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.rductControl.untilPageNum != 0){ if($P.rductControl.untilPageNum != 0){
$P.rductControl.query.fetchSize = $P.rductControl.defaultFetchSize; $P.rductControl.query.fetchSize = $P.rductControl.defaultFetchSize;
@ -340,7 +321,8 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchRductList()); $('#btnSearch--${pageName}').on('click', () => $P.searchRductList());
$("#table-responsive--${pageName}").on("scrollend", function(){ $P.scrollEnd(this); });
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollRductList);
/************************************************************************** /**************************************************************************
* 초기화 * 초기화

@ -161,3 +161,55 @@ function fnMakeRowNumberingTable(tbody, markerFinder, markerSetter){
var mo = new MutationObserver(moCallbackFunc); var mo = new MutationObserver(moCallbackFunc);
mo.observe(tbody, {childList : true}); mo.observe(tbody, {childList : true});
} }
/**************************************************************************
* 스크롤 테이블
**************************************************************************/
function fnMakeScrollableTable(tableScrollEl, thisScrollendEvent){
tableScrollEl.thisScrollendEvent = thisScrollendEvent;
tableScrollEl.changeContent = function(content, initScrollPosition, noMore){
var beforeRender = this.scrollTop;
$(this).find("tbody").html(content);
this.scrollTop = 0;
var min = this.scrollTop;
this.scrollTop = this.scrollHeight;
var max = this.scrollTop;
var hasScroll = (min != max);
var more = document.createElement("tr");
if(hasScroll && !noMore){
more.style.height = "30px";
$(this).find("tbody").append(more);
var ioCallbackFunc = function(entries, observer){
var entry = entries[0];
var target = entry.target;
if(entry.isIntersecting){
observer.unobserve(target);
tableScrollEl.thisScrollendEvent();
}
};
var io = new IntersectionObserver(ioCallbackFunc, {threshold : 0.5});
io.observe(more);
}
if(initScrollPosition){
this.scrollTop = 0;
} else {
var afterRender = this.scrollTop;
if(beforeRender < afterRender){
this.scrollTop = beforeRender;
}
}
};
}
Loading…
Cancel
Save