diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn03010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn03010-main.jsp index c48174a4..ef2c6914 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn03010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn03010-main.jsp @@ -204,7 +204,7 @@ $(document).ready(function(){ Apply.toDataset.set(ctrl.dataset, resp); ctrl.dataset.onDatasetChange(resp, {reloaded : true}); - let todoCurrent = Apply.fromDataset.getTodoCurrent(ctrl.dataset, ctrl.beforeCurrent, "CRDN_ID_LIST"); + let todoCurrent = Apply.fromDataset.getTodoCurrent(ctrl.dataset, ctrl.beforeCurrent, "CRDN_ID"); ctrl.beforeCurrent = null; if(todoCurrent != null){ ctrl.dataset.setCurrent(todoCurrent.index, true); diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01010-main.jsp index ab005eb7..96faef63 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01010-main.jsp @@ -339,8 +339,8 @@ $(document).ready(function(){ $P.refreshCrdnList = () => { ctrl.beforeCurrent = { - key : ctrl.dataset.getCurrent()["CRDN_ID"], - index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1 + primaryKey : ctrl.dataset.getCurrent()["CRDN_ID"], + arrayIndex : ctrl.dataset.getCurrent()["ROW_NUM"] - 1 }; Apply.fromDatasetControl.reload(ctrl).then((resp)=>{ @@ -348,27 +348,10 @@ $(document).ready(function(){ Apply.toDataset.set(ctrl.dataset, resp); ctrl.dataset.onDatasetChange(resp, {reloaded : true}); - if(ctrl.beforeCurrent != null){ - var beforeCurrentKey = ctrl.beforeCurrent.key; - var beforeCurrentIndex = ctrl.beforeCurrent.index; - ctrl.beforeCurrent = null; - - if(!ctrl.dataset.empty){ - var info = ctrl.dataset.getData(beforeCurrentKey); - - if(info != null){ - ctrl.dataset.setCurrent(beforeCurrentKey,true); - } else { - - if(beforeCurrentIndex > (ctrl.dataset.length - 1)){ - info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1]; - } else { - info = ctrl.dataset.getDataset()[beforeCurrentIndex]; - } - - ctrl.dataset.setCurrent(info["CRDN_ID"],true); - } - } + let todoCurrent = Apply.fromDataset.getTodoCurrent(ctrl.dataset, ctrl.beforeCurrent, "CRDN_ID"); + ctrl.beforeCurrent = null; + if(todoCurrent != null){ + ctrl.dataset.setCurrent(todoCurrent.index, true); } $(".parentGrid").each(function(){ diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc02010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc02010-main.jsp index b867c1d3..04e49efb 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc02010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc02010-main.jsp @@ -250,7 +250,6 @@ $(document).ready(function(){ var ctrl = newCvlc02010Control($P); ctrl.defaultFetchSize = FETCH_XS; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize }; - ctrl.beforeCurrent = null; ctrl.dataset.onDatasetChange = (obj, option) => { diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc03010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc03010-main.jsp index 143efd62..1178a617 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc03010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc03010-main.jsp @@ -307,36 +307,20 @@ $(document).ready(function(){ $P.refreshCrdnList = () => { ctrl.beforeCurrent = { - key : ctrl.dataset.getCurrent()["CRDN_ID"], - index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1 + primaryKey : ctrl.dataset.getCurrent()["CRDN_ID"], + arrayIndex : ctrl.dataset.getCurrent()["ROW_NUM"] - 1 }; Apply.fromDatasetControl.reload(ctrl).then((resp)=>{ Apply.toDataset.set(ctrl.dataset, resp); ctrl.dataset.onDatasetChange(resp, {reloaded : true}); - if(ctrl.beforeCurrent != null){ - var beforeCurrentKey = ctrl.beforeCurrent.key; - var beforeCurrentIndex = ctrl.beforeCurrent.index; - ctrl.beforeCurrent = null; - - if(!ctrl.dataset.empty){ - var info = ctrl.dataset.getData(beforeCurrentKey); - - if(info != null){ - ctrl.dataset.setCurrent(beforeCurrentKey,true); - } else { - if(beforeCurrentIndex > (ctrl.dataset.length - 1)){ - info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1]; - } else { - info = ctrl.dataset.getDataset()[beforeCurrentIndex]; - } - - ctrl.dataset.setCurrent(info["CRDN_ID"],true); - } - } + let todoCurrent = Apply.fromDataset.getTodoCurrent(ctrl.dataset, ctrl.beforeCurrent, "CRDN_ID"); + ctrl.beforeCurrent = null; + if(todoCurrent != null){ + ctrl.dataset.setCurrent(todoCurrent.index, true); } - + }); } diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp index 20987ef1..e96a8f99 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp @@ -235,8 +235,8 @@ $(document).ready(function(){ if(!ctrl.dataset.empty){ ctrl.beforeCurrent = { - key : ctrl.dataset.getCurrent()["INDIV_ID"], - index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1 + primaryKey : ctrl.dataset.getCurrent()["INDIV_ID"], + arrayIndex : ctrl.dataset.getCurrent()["ROW_NUM"] - 1 }; } @@ -244,27 +244,10 @@ $(document).ready(function(){ Apply.toDataset.set(ctrl.dataset, resp); ctrl.dataset.onDatasetChange(resp, {reloaded : true}); - if(ctrl.beforeCurrent != null){ - var beforeCurrentKey = ctrl.beforeCurrent.key; - var beforeCurrentIndex = ctrl.beforeCurrent.index; - ctrl.beforeCurrent = null; - - if(!ctrl.dataset.empty){ - var info = ctrl.dataset.getData(beforeCurrentKey); - - if(info != null){ - ctrl.dataset.setCurrent(beforeCurrentKey,true); - } else { - - if(beforeCurrentIndex > (ctrl.dataset.length - 1)){ - info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1]; - } else { - info = ctrl.dataset.getDataset()[beforeCurrentIndex]; - } - - ctrl.dataset.setCurrent(info["INDIV_ID"],true); - } - } + let todoCurrent = Apply.fromDataset.getTodoCurrent(ctrl.dataset, ctrl.beforeCurrent, "INDIV_ID"); + ctrl.beforeCurrent = null; + if(todoCurrent != null){ + ctrl.dataset.setCurrent(todoCurrent.index, true); } });