소스 정리

main
이범준 3 months ago
parent b182516f99
commit 3cd9bf9438

@ -204,7 +204,7 @@ $(document).ready(function(){
Apply.toDataset.set(ctrl.dataset, resp); Apply.toDataset.set(ctrl.dataset, resp);
ctrl.dataset.onDatasetChange(resp, {reloaded : true}); 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; ctrl.beforeCurrent = null;
if(todoCurrent != null){ if(todoCurrent != null){
ctrl.dataset.setCurrent(todoCurrent.index, true); ctrl.dataset.setCurrent(todoCurrent.index, true);

@ -339,8 +339,8 @@ $(document).ready(function(){
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
ctrl.beforeCurrent = { ctrl.beforeCurrent = {
key : ctrl.dataset.getCurrent()["CRDN_ID"], primaryKey : ctrl.dataset.getCurrent()["CRDN_ID"],
index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1 arrayIndex : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload(ctrl).then((resp)=>{ Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
@ -348,27 +348,10 @@ $(document).ready(function(){
Apply.toDataset.set(ctrl.dataset, resp); Apply.toDataset.set(ctrl.dataset, resp);
ctrl.dataset.onDatasetChange(resp, {reloaded : true}); ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if(ctrl.beforeCurrent != null){ let todoCurrent = Apply.fromDataset.getTodoCurrent(ctrl.dataset, ctrl.beforeCurrent, "CRDN_ID");
var beforeCurrentKey = ctrl.beforeCurrent.key; ctrl.beforeCurrent = null;
var beforeCurrentIndex = ctrl.beforeCurrent.index; if(todoCurrent != null){
ctrl.beforeCurrent = null; ctrl.dataset.setCurrent(todoCurrent.index, true);
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);
}
}
} }
$(".parentGrid").each(function(){ $(".parentGrid").each(function(){

@ -250,7 +250,6 @@ $(document).ready(function(){
var ctrl = newCvlc02010Control($P); var ctrl = newCvlc02010Control($P);
ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
ctrl.dataset.onDatasetChange = (obj, option) => { ctrl.dataset.onDatasetChange = (obj, option) => {

@ -307,34 +307,18 @@ $(document).ready(function(){
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
ctrl.beforeCurrent = { ctrl.beforeCurrent = {
key : ctrl.dataset.getCurrent()["CRDN_ID"], primaryKey : ctrl.dataset.getCurrent()["CRDN_ID"],
index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1 arrayIndex : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload(ctrl).then((resp)=>{ Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set(ctrl.dataset, resp); Apply.toDataset.set(ctrl.dataset, resp);
ctrl.dataset.onDatasetChange(resp, {reloaded : true}); ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if(ctrl.beforeCurrent != null){ let todoCurrent = Apply.fromDataset.getTodoCurrent(ctrl.dataset, ctrl.beforeCurrent, "CRDN_ID");
var beforeCurrentKey = ctrl.beforeCurrent.key; ctrl.beforeCurrent = null;
var beforeCurrentIndex = ctrl.beforeCurrent.index; if(todoCurrent != null){
ctrl.beforeCurrent = null; ctrl.dataset.setCurrent(todoCurrent.index, true);
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);
}
}
} }
}); });

@ -235,8 +235,8 @@ $(document).ready(function(){
if(!ctrl.dataset.empty){ if(!ctrl.dataset.empty){
ctrl.beforeCurrent = { ctrl.beforeCurrent = {
key : ctrl.dataset.getCurrent()["INDIV_ID"], primaryKey : ctrl.dataset.getCurrent()["INDIV_ID"],
index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1 arrayIndex : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
} }
@ -244,27 +244,10 @@ $(document).ready(function(){
Apply.toDataset.set(ctrl.dataset, resp); Apply.toDataset.set(ctrl.dataset, resp);
ctrl.dataset.onDatasetChange(resp, {reloaded : true}); ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if(ctrl.beforeCurrent != null){ let todoCurrent = Apply.fromDataset.getTodoCurrent(ctrl.dataset, ctrl.beforeCurrent, "INDIV_ID");
var beforeCurrentKey = ctrl.beforeCurrent.key; ctrl.beforeCurrent = null;
var beforeCurrentIndex = ctrl.beforeCurrent.index; if(todoCurrent != null){
ctrl.beforeCurrent = null; ctrl.dataset.setCurrent(todoCurrent.index, true);
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);
}
}
} }
}); });

Loading…
Cancel
Save