스크롤링 수정

main
이범준 1 year ago
parent 3a9772a555
commit d0a1672331

@ -155,13 +155,13 @@ pageObject["${pageName}"] = {};
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
$P.scrollable = true;
$P.holdList = []; $P.holdList = [];
$P.toast = new bootstrap.Toast(document.getElementById('divToast--${pageName}'), { $P.toast = new bootstrap.Toast(document.getElementById('divToast--${pageName}'), {
animation: true, animation: true,
autohide: true, autohide: true,
delay: 2000, delay: 2000
}); });
/************************************************************************** /**************************************************************************
@ -181,11 +181,11 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl.on * DatasetControl.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = obj => { $P.crdnControl.onDatasetChange = (obj) => {
var prefix = obj.infoPrefix;
$P.renderCrdnList(); $P.renderCrdnList(obj[prefix+"Total"]);
var prefix = obj.infoPrefix;
$("#crdnPaging--${pageName}").setPagingInfo({ $("#crdnPaging--${pageName}").setPagingInfo({
list: $P.crdnControl.dataset, list: $P.crdnControl.dataset,
prefix: "crdnPaging--${pageName}", prefix: "crdnPaging--${pageName}",
@ -212,12 +212,8 @@ $(document).ready(function(){
$P.crdnControl.onRemove = (selected, resp) => { $P.crdnControl.onRemove = (selected, resp) => {
if (resp.saved){ if (resp.saved){
var removed = $P.crdnControl.dataset.getKeys("selected");
$P.crdnControl.dataset.remove(removed);
removed.forEach(function(item){
$("#crdnTbody--${pageName}").find("tr[data-key='"+item+"']").remove();
});
$P.toast.show(); $P.toast.show();
$P.crdnControl._load();
} }
} }
@ -251,7 +247,7 @@ $(document).ready(function(){
} }
$P.scrollEnd = (obj) => { $P.scrollEnd = (obj) => {
if(!$P.scrollable){ if(obj.dataset.scrollStatus){
return; return;
} }
@ -261,7 +257,7 @@ $(document).ready(function(){
} }
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
$P.scrollable = false; obj.dataset.scrollStatus = "waiting";
$P.scrollCrdnList(); $P.scrollCrdnList();
} }
} }
@ -287,7 +283,7 @@ $(document).ready(function(){
$P.crdnControl.getInfo(dataKey); $P.crdnControl.getInfo(dataKey);
} }
$P.renderCrdnList = () => { $P.renderCrdnList = (total) => {
var crdnList = $P.crdnControl.dataset; var crdnList = $P.crdnControl.dataset;
var empty = crdnList.empty; var empty = crdnList.empty;
@ -302,7 +298,11 @@ $(document).ready(function(){
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
$P.scrollable = true; if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
$P.holdList.forEach(function(item){ $P.holdList.forEach(function(item){
$("#crdnTbody--${pageName}").find("tr[data-key='"+item+"']").addClass("bg-dark"); $("#crdnTbody--${pageName}").find("tr[data-key='"+item+"']").addClass("bg-dark");

@ -153,7 +153,6 @@ pageObject["${pageName}"] = {};
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
$P.scrollable = true;
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
@ -173,11 +172,11 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl.on * DatasetControl.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = obj => { $P.crdnControl.onDatasetChange = (obj) => {
var prefix = obj.infoPrefix;
$P.renderCrdnList(); $P.renderCrdnList(obj[prefix+"Total"]);
var prefix = obj.infoPrefix;
$("#crdnPaging--${pageName}").setPagingInfo({ $("#crdnPaging--${pageName}").setPagingInfo({
list: $P.crdnControl.dataset, list: $P.crdnControl.dataset,
prefix: "crdnPaging--${pageName}", prefix: "crdnPaging--${pageName}",
@ -217,7 +216,7 @@ $(document).ready(function(){
} }
$P.scrollEnd = (obj) => { $P.scrollEnd = (obj) => {
if(!$P.scrollable){ if(obj.dataset.scrollStatus){
return; return;
} }
@ -227,7 +226,7 @@ $(document).ready(function(){
} }
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
$P.scrollable = false; obj.dataset.scrollStatus = "waiting";
$P.scrollCrdnList(); $P.scrollCrdnList();
} }
} }
@ -245,7 +244,7 @@ $(document).ready(function(){
$P.crdnControl.getInfo(dataKey); $P.crdnControl.getInfo(dataKey);
} }
$P.renderCrdnList = () => { $P.renderCrdnList = (total) => {
var crdnList = $P.crdnControl.dataset; var crdnList = $P.crdnControl.dataset;
var empty = crdnList.empty; var empty = crdnList.empty;
@ -260,7 +259,11 @@ $(document).ready(function(){
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
$P.scrollable = true; if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
} }
$P.getParams = () => { $P.getParams = () => {

@ -110,7 +110,6 @@ pageObject["${pageName}"] = {};
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
$P.scrollable = true;
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
@ -164,7 +163,9 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = (obj) => { $P.crdnControl.onDatasetChange = (obj) => {
$P.renderCrdnList(); var prefix = obj.infoPrefix;
$P.renderCrdnList(obj[prefix+"Total"]);
$("#crdnPaging--${pageName}").setPagingInfo({ $("#crdnPaging--${pageName}").setPagingInfo({
list: $P.crdnControl.dataset, list: $P.crdnControl.dataset,
@ -216,7 +217,7 @@ $(document).ready(function(){
} }
$P.scrollEnd = (obj) => { $P.scrollEnd = (obj) => {
if(!$P.scrollable){ if(obj.dataset.scrollStatus){
return; return;
} }
@ -226,7 +227,7 @@ $(document).ready(function(){
} }
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
$P.scrollable = false; obj.dataset.scrollStatus = "waiting";
$P.scrollCrdnList(); $P.scrollCrdnList();
} }
} }
@ -240,7 +241,7 @@ $(document).ready(function(){
$("#crdnTbody--${pageName}").setCurrentRow(dataKey); $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
} }
$P.renderCrdnList = () => { $P.renderCrdnList = (total) => {
var crdnList = $P.crdnControl.dataset; var crdnList = $P.crdnControl.dataset;
var empty = crdnList.empty; var empty = crdnList.empty;
@ -257,7 +258,11 @@ $(document).ready(function(){
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
$P.scrollable = true; if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
} }
$P.getParams = () => { $P.getParams = () => {

@ -223,7 +223,6 @@ pageObject["${pageName}"] = {};
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
$P.scrollable = true;
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
@ -262,9 +261,10 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = obj => { $P.crdnControl.onDatasetChange = obj => {
$P.renderCrdnList();
var prefix = obj.infoPrefix; var prefix = obj.infoPrefix;
$P.renderCrdnList(obj[prefix+"Total"]);
$("#crdnPaging--${pageName}").setPagingInfo({ $("#crdnPaging--${pageName}").setPagingInfo({
list: $P.crdnControl.dataset, list: $P.crdnControl.dataset,
prefix: "crdnPaging--${pageName}", prefix: "crdnPaging--${pageName}",
@ -329,7 +329,7 @@ $(document).ready(function(){
} }
$P.scrollEnd = (obj) => { $P.scrollEnd = (obj) => {
if(!$P.scrollable){ if(obj.dataset.scrollStatus){
return; return;
} }
@ -339,7 +339,7 @@ $(document).ready(function(){
} }
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
$P.scrollable = false; obj.dataset.scrollStatus = "waiting";
$P.scrollCrdnList(); $P.scrollCrdnList();
} }
} }
@ -357,7 +357,7 @@ $(document).ready(function(){
$P.crdnControl.getInfo(dataKey); $P.crdnControl.getInfo(dataKey);
} }
$P.renderCrdnList = () => { $P.renderCrdnList = (total) => {
var crdnList = $P.crdnControl.dataset; var crdnList = $P.crdnControl.dataset;
var empty = crdnList.empty; var empty = crdnList.empty;
@ -381,7 +381,11 @@ $(document).ready(function(){
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드 fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
$P.scrollable = true; if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
} }
$P.getParams = () => { $P.getParams = () => {

@ -335,7 +335,6 @@ pageObject["${pageName}"] = {};
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
$P.scrollable = true;
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
@ -398,9 +397,10 @@ $(document).ready(function(){
}; };
$P.sameVehicleControl.main.onDatasetChange = (obj) => { $P.sameVehicleControl.main.onDatasetChange = (obj) => {
$P.renderInspectionDataList("sameVehicleInspectionMain");
var prefix = obj.infoPrefix; var prefix = obj.infoPrefix;
$P.renderInspectionDataList(obj[prefix+"Total"], "sameVehicleInspectionMain");
$("#sameVehicleInspectionMainPaging--${pageName}").setPagingInfo({ $("#sameVehicleInspectionMainPaging--${pageName}").setPagingInfo({
list: $P.sameVehicleControl.main.dataset, list: $P.sameVehicleControl.main.dataset,
prefix: "sameVehicleInspectionMainPaging--${pageName}", prefix: "sameVehicleInspectionMainPaging--${pageName}",
@ -412,7 +412,10 @@ $(document).ready(function(){
$P.sameVehicleControl.sub.onDatasetChange = (obj) => { $P.sameVehicleControl.sub.onDatasetChange = (obj) => {
$P.renderInspectionDataList("sameVehicleInspectionSub"); var prefix = obj.infoPrefix;
$P.renderInspectionDataList(obj[prefix+"Total"], "sameVehicleInspectionSub");
}; };
/************************************************************************** /**************************************************************************
@ -487,7 +490,7 @@ $(document).ready(function(){
} }
$P.scrollEnd = (obj) => { $P.scrollEnd = (obj) => {
if(!$P.scrollable){ if(obj.dataset.scrollStatus){
return; return;
} }
@ -497,7 +500,7 @@ $(document).ready(function(){
} }
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
$P.scrollable = false; obj.dataset.scrollStatus = "waiting";
$P.scrollInspectionDataList(); $P.scrollInspectionDataList();
} }
} }
@ -586,7 +589,7 @@ $(document).ready(function(){
}; };
$P.renderInspectionDataList = (renderDataType) => { $P.renderInspectionDataList = (total, renderDataType) => {
switch (renderDataType) { switch (renderDataType) {
case "photoInspection": case "photoInspection":
@ -599,6 +602,12 @@ $(document).ready(function(){
.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()); $("#photoInspectionTbody--${pageName}").html(trs.join());
if(total == dataList.length){
$("#photoInspection-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#photoInspection-responsive--${pageName}").removeAttr("data-scroll-status");
}
break; break;
case "sameVehicleInspectionMain": case "sameVehicleInspectionMain":
var dataList = $P.sameVehicleControl.main.dataset; var dataList = $P.sameVehicleControl.main.dataset;
@ -609,6 +618,12 @@ $(document).ready(function(){
.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()); $("#sameVehicleInspectionMainTbody--${pageName}").html(trs.join());
if(total == dataList.length){
$("#sameVehicleInspectionMain-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#sameVehicleInspectionMain-responsive--${pageName}").removeAttr("data-scroll-status");
}
break; break;
case "sameVehicleInspectionSub": case "sameVehicleInspectionSub":
var dataList = $P.sameVehicleControl.sub.dataset; var dataList = $P.sameVehicleControl.sub.dataset;
@ -626,8 +641,6 @@ $(document).ready(function(){
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
$P.scrollable = true;
} }
$P.getParams = () => { $P.getParams = () => {

@ -122,7 +122,6 @@ pageObject["${pageName}"] = {};
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
$P.scrollable = true;
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
@ -148,9 +147,10 @@ $(document).ready(function(){
* DatasetControl.on * DatasetControl.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = obj => { $P.crdnControl.onDatasetChange = obj => {
$P.renderCrdnList();
var prefix = obj.infoPrefix; var prefix = obj.infoPrefix;
$P.renderCrdnList(obj[prefix+"Total"]);
$("#crdnPaging--${pageName}").setPagingInfo({ $("#crdnPaging--${pageName}").setPagingInfo({
list: $P.crdnControl.dataset, list: $P.crdnControl.dataset,
prefix: "crdnPaging--${pageName}", prefix: "crdnPaging--${pageName}",
@ -177,7 +177,7 @@ $(document).ready(function(){
} }
$P.scrollEnd = (obj) => { $P.scrollEnd = (obj) => {
if(!$P.scrollable){ if(obj.dataset.scrollStatus){
return; return;
} }
@ -187,7 +187,7 @@ $(document).ready(function(){
} }
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
$P.scrollable = false; obj.dataset.scrollStatus = "waiting";
$P.scrollCrdnList(); $P.scrollCrdnList();
} }
} }
@ -206,7 +206,7 @@ $(document).ready(function(){
} }
$P.renderCrdnList = () => { $P.renderCrdnList = (total) => {
var crdnList = $P.crdnControl.dataset; var crdnList = $P.crdnControl.dataset;
var empty = crdnList.empty; var empty = crdnList.empty;
@ -222,7 +222,11 @@ $(document).ready(function(){
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
$P.scrollable = true; if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
} }

@ -134,7 +134,6 @@ pageObject["${pageName}"] = {};
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
$P.scrollable = true;
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
@ -156,9 +155,10 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl.on * DatasetControl.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = obj => { $P.crdnControl.onDatasetChange = (obj) => {
var prefix = obj.infoPrefix;
$P.renderCrdnList(); $P.renderCrdnList(obj[prefix+"Total"]);
$("#crdnPaging--${pageName}").setPagingInfo({ $("#crdnPaging--${pageName}").setPagingInfo({
list: $P.crdnControl.dataset, list: $P.crdnControl.dataset,
@ -199,7 +199,7 @@ $(document).ready(function(){
} }
$P.scrollEnd = (obj) => { $P.scrollEnd = (obj) => {
if(!$P.scrollable){ if(obj.dataset.scrollStatus){
return; return;
} }
@ -209,7 +209,7 @@ $(document).ready(function(){
} }
if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){ if((el[0].scrollHeight - el.scrollTop() + VERTICAL_SCROLL_HEIGHT) <= el.outerHeight()){
$P.scrollable = false; obj.dataset.scrollStatus = "waiting";
$P.scrollCrdnList(); $P.scrollCrdnList();
} }
} }
@ -227,7 +227,7 @@ $(document).ready(function(){
$P.crdnControl.getInfo(dataKey); $P.crdnControl.getInfo(dataKey);
} }
$P.renderCrdnList = () => { $P.renderCrdnList = (total) => {
var crdnList = $P.crdnControl.dataset; var crdnList = $P.crdnControl.dataset;
var empty = crdnList.empty; var empty = crdnList.empty;
@ -244,7 +244,11 @@ $(document).ready(function(){
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
$P.scrollable = true; if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
} }
$P.getParams = () => { $P.getParams = () => {

Loading…
Cancel
Save