DatasetControl keyMapper 설정 수정

main
이범준 3 months ago
parent 08a96d32be
commit 746c899280

@ -63,16 +63,18 @@ $(document).ready(function() {
}; };
// 현재 선택 자료 변경 이벤트 // 현재 선택 자료 변경 이벤트
ctrl.upDataset.onCurrentChange = (DI) => { ctrl.upDataset.onCurrentChange = (dataItem) => {
if (!DI) return; if (!dataItem) {
var key = DI.data.CRDN_ID; return;
$P.$findn("upTbody").setCurrentRow(key); }
$P.$findn("upTbody").setCurrentRow(dataItem.index);
}; };
ctrl.downDataset.onCurrentChange = (DI) => { ctrl.downDataset.onCurrentChange = (dataItem) => {
if (!DI) return; if (!dataItem) {
var key = DI.data.CRDN_ID; return;
$P.$findn("downTbody").setCurrentRow(key); }
$P.$findn("downTbody").setCurrentRow(dataItem.index);
}; };
// 선택(체크) 변경 이벤트 // 선택(체크) 변경 이벤트
@ -290,11 +292,11 @@ $(document).ready(function() {
var replacer; var replacer;
if(updown == "up"){ if(updown == "up"){
replacer = (str, dataItem) => str replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].ctrl.upDataset.setCurrent('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].ctrl.upDataset.setCurrent('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');") .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');")
} else { } else {
replacer = (str, dataItem) => str replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].ctrl.downDataset.setCurrent('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].ctrl.downDataset.setCurrent('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');") .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');")
} }
@ -758,17 +760,20 @@ $(document).ready(function() {
var downDataset = ctrl.downDataset; var downDataset = ctrl.downDataset;
if(upDataset.length > 0){ if(upDataset.length > 0){
var info = upDataset.getData(crdnId); let filtered = upDataset.getDataset("item").filter(item=>item.data.CRDN_ID == crdnId);
if(info != null){ if(filtered != null && filtered.length > 0){
let info = upDataset.getData(filtered[0].index);
return info; return info;
} }
} }
if(downDataset.length > 0){ if(downDataset.length > 0){
var info = downDataset.getData(crdnId); let filtered = downDataset.getDataset("item").filter(item=>item.data.CRDN_ID == crdnId);
if(info != null){ if(filtered != null && filtered.length > 0){
let info = downDataset.getData(filtered[0].index);
return info; return info;
} }
} }
return null; return null;

@ -4,10 +4,10 @@
<c:set var="pageKorName" scope="request">통합조회 그리드 템플릿(내용)</c:set> <c:set var="pageKorName" scope="request">통합조회 그리드 템플릿(내용)</c:set>
<template is="curly-brackets" name="row"> <template is="curly-brackets" name="row">
<tr data-key="CRDN_ID"> <tr data-index="DATA-INDEX">
<td class="cmn text-center"> <td class="cmn text-center">
<input type="checkbox" class="form-check-input" name="gridCheckbox" value="CRDN_ID" <input type="checkbox" class="form-check-input" name="gridCheckbox" value="DATA-INDEX"
onchange="pageObject['${pageName}'].selectCheckbox(this,'{CRDN_ID}', this.checked);"> onchange="pageObject['${pageName}'].selectCheckbox(this,'{DATA-INDEX}', this.checked);">
</td> </td>
<td class="cmn text-center" onclick ondblclick>SGG_NM</td> <td class="cmn text-center" onclick ondblclick>SGG_NM</td>
<td class="cmn text-center" onclick ondblclick>TASK_SE_NM</td> <td class="cmn text-center" onclick ondblclick>TASK_SE_NM</td>

@ -24,15 +24,15 @@
</thead> </thead>
<tbody name="tbody"> <tbody name="tbody">
</tbody> </tbody>
<template name="found"> <template is="curly-brackets" name="found">
<tr data-key="{CRDN_ID}" onclick="pageObject['${pageName}'].clickGrid(this);"> <tr data-key="CRDN_ID" onclick="pageObject['${pageName}'].clickGrid(this);">
<td>{SGG_NM}</td> <td>SGG_NM</td>
<td>{TASK_SE_NM}</td> <td>TASK_SE_NM</td>
<td>{CRDN_YMD_TM}</td> <td>CRDN_YMD_TM</td>
<td>{VHRNO}</td> <td>VHRNO</td>
<td>{RPM_SZR_VHRNO}</td> <td>RPM_SZR_VHRNO</td>
<td>{RTPYR_NM}</td> <td>RTPYR_NM</td>
<td>{CRDN_STTS_NM}</td> <td>CRDN_STTS_NM</td>
</tr> </tr>
</template> </template>
</table> </table>

@ -45,23 +45,23 @@
</thead> </thead>
<tbody name="tbody"> <tbody name="tbody">
</tbody> </tbody>
<template name="found"> <template is="curly-brackets" name="found">
<tr data-key="{CRDN_ID}" onclick="pageObject['${pageName}'].clickGrid(this);"> <tr data-key="CRDN_ID" onclick="pageObject['${pageName}'].clickGrid(this);">
<td>{SGG_NM}</td> <td>SGG_NM</td>
<td>{TASK_SE_NM}</td> <td>TASK_SE_NM</td>
<td>{RPM_SZR_VHRNO}</td> <td>RPM_SZR_VHRNO</td>
<td>{VHRNO}</td> <td>VHRNO</td>
<th>{CRDN_SE_NM}</th> <td>CRDN_SE_NM</td>
<td>{CRDN_YMD_TM}</td> <td>CRDN_YMD_TM</td>
<td>{CRDN_PLC}</td> <td>CRDN_PLC</td>
<td>{GOJI_NO}</td> <td>GOJI_NO</td>
<td>{RCVMT_YMD}</td> <td>RCVMT_YMD</td>
<td>{CRDN_STTS_NM}</td> <td>CRDN_STTS_NM</td>
<td>{RCVMT_AMT}</td> <td>RCVMT_AMT</td>
<td>{SUM_AMT}</td> <td>SUM_AMT</td>
<td>{RTPYR_NM}</td> <td>RTPYR_NM</td>
<td>{RTPYR_ADDR}</td> <td>RTPYR_ADDR</td>
<td>{RTPYR_DTL_ADDR}</td> <td>RTPYR_DTL_ADDR</td>
</tr> </tr>
</template> </template>
</table> </table>
@ -119,8 +119,10 @@ $(document).ready(function(){
$P.fnExcelDown = () => { $P.fnExcelDown = () => {
var query = {}; var query = {};
var cellDefs = AppSupport.getCellDefs($P.$findn("theadTr").find("th").not(".dummy-th"), var cellDefs = AppSupport.getCellDefs(
$($P.findn("found").content).find("td").not(".dummy-td")); $P.$findn("theadTr").find("th").not(".dummy-th"),
$($P.findn("found").content).find("td").not(".dummy-td")
);
query.cellDefs = cellDefs; query.cellDefs = cellDefs;
query.download = "xls"; query.download = "xls";

@ -17,8 +17,7 @@
<div class="card-datatable text-nowrap mb-3"> <div class="card-datatable text-nowrap mb-3">
<div class="dataTables_wrapper dt-bootstrap5 no-footer"> <div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div class="table-responsive ox-scroll oy-scroll h-px-300"> <div class="table-responsive ox-scroll oy-scroll h-px-300">
<table name="table" <table name="table" class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer">
class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer">
<thead class="sticky-thead" > <thead class="sticky-thead" >
<tr name="theadTr"> <tr name="theadTr">
<th style="width:120px">시군구명</th> <th style="width:120px">시군구명</th>
@ -40,23 +39,23 @@
</thead> </thead>
<tbody name="tbody"> <tbody name="tbody">
</tbody> </tbody>
<template name="found"> <template is="curly-brackets" name="found">
<tr data-key="{CRDN_ID}" onclick="pageObject['${pageName}'].clickGrid(this);"> <tr data-key="CRDN_ID" onclick="pageObject['${pageName}'].clickGrid(this);">
<td>{SGG_NM}</td> <td>SGG_NM</td>
<td>{TASK_SE_NM}</td> <td>TASK_SE_NM</td>
<td>{RPM_SZR_VHRNO}</td> <td>RPM_SZR_VHRNO</td>
<td>{VHRNO}</td> <td>VHRNO</td>
<th>{CRDN_SE_NM}</th> <td>CRDN_SE_NM</td>
<td>{CRDN_YMD_TM}</td> <td>CRDN_YMD_TM</td>
<td>{CRDN_PLC}</td> <td>CRDN_PLC</td>
<td>{GOJI_NO}</td> <td>GOJI_NO</td>
<td>{RCVMT_YMD}</td> <td>RCVMT_YMD</td>
<td>{CRDN_STTS_NM}</td> <td>CRDN_STTS_NM</td>
<td>{RCVMT_AMT}</td> <td>RCVMT_AMT</td>
<td>{SUM_AMT}</td> <td>SUM_AMT</td>
<td>{RTPYR_NM}</td> <td>RTPYR_NM</td>
<td>{RTPYR_ADDR}</td> <td>RTPYR_ADDR</td>
<td>{RTPYR_DTL_ADDR}</td> <td>RTPYR_DTL_ADDR</td>
</tr> </tr>
</template> </template>
</table> </table>

@ -19,8 +19,7 @@
<div class="card-datatable text-nowrap mb-3"> <div class="card-datatable text-nowrap mb-3">
<div class="dataTables_wrapper dt-bootstrap5 no-footer"> <div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div class="table-responsive ox-scroll oy-scroll h-px-300"> <div class="table-responsive ox-scroll oy-scroll h-px-300">
<table name="table" <table name="table" class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer">
class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer">
<thead class="sticky-thead" > <thead class="sticky-thead" >
<tr name="theadTr"> <tr name="theadTr">
<th style="width:50px"> <th style="width:50px">
@ -46,26 +45,26 @@
</thead> </thead>
<tbody name="tbody"> <tbody name="tbody">
</tbody> </tbody>
<template name="found"> <template is="curly-brackets" name="found">
<tr data-key="{CRDN_ID}" onclick="pageObject['${pageName}'].clickGrid(this);"> <tr data-key="CRDN_ID" onclick="pageObject['${pageName}'].clickGrid(this);">
<td> <td>
<input type="checkbox" class="form-check-input" name="gridCheckbox" value="{CRDN_ID}" checked <input type="checkbox" class="form-check-input" name="gridCheckbox" value="CRDN_ID" checked
onchange="GRID.checkbox.sync(this, this.checked);" /> onchange="GRID.checkbox.sync(this, this.checked);" />
</td> </td>
<td>{SGG_NM}</td> <td>SGG_NM</td>
<td>{TASK_SE_NM}</td> <td>TASK_SE_NM</td>
<td>{VHRNO}</td> <td>VHRNO</td>
<td>{RPM_SZR_VHRNO}</td> <td>RPM_SZR_VHRNO</td>
<td>{CRDN_YMD_TM}</td> <td>CRDN_YMD_TM</td>
<td>{CRDN_PLC}</td> <td>CRDN_PLC</td>
<td>{GOJI_NO}</td> <td>GOJI_NO</td>
<td>{RCVMT_YMD}</td> <td>RCVMT_YMD</td>
<td>{CRDN_STTS_NM}</td> <td>CRDN_STTS_NM</td>
<td>{RCVMT_AMT}</td> <td>RCVMT_AMT</td>
<td>{SUM_AMT}</td> <td>SUM_AMT</td>
<td>{RTPYR_NM}</td> <td>RTPYR_NM</td>
<td>{RTPYR_ADDR}</td> <td>RTPYR_ADDR</td>
<td>{RTPYR_DTL_ADDR}</td> <td>RTPYR_DTL_ADDR</td>
</tr> </tr>
</template> </template>
</table> </table>

@ -19,8 +19,7 @@
<div class="card-datatable text-nowrap mb-3"> <div class="card-datatable text-nowrap mb-3">
<div class="dataTables_wrapper dt-bootstrap5 no-footer"> <div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div class="table-responsive ox-scroll oy-scroll h-px-300"> <div class="table-responsive ox-scroll oy-scroll h-px-300">
<table name="table" <table name="table" class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer">
class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer">
<thead class="sticky-thead" > <thead class="sticky-thead" >
<tr name="theadTr"> <tr name="theadTr">
<th style="width:50px"> <th style="width:50px">
@ -45,25 +44,25 @@
</thead> </thead>
<tbody name="tbody"> <tbody name="tbody">
</tbody> </tbody>
<template name="found"> <template is="curly-brackets" name="found">
<tr data-key="{CRDN_ID}" onclick="pageObject['${pageName}'].clickGrid(this);"> <tr data-key="CRDN_ID" onclick="pageObject['${pageName}'].clickGrid(this);">
<td> <td>
<input type="checkbox" class="form-check-input" name="gridCheckbox" value="{CRDN_ID}" checked <input type="checkbox" class="form-check-input" name="gridCheckbox" value="CRDN_ID" checked
onchange="GRID.checkbox.sync(this, this.checked);" /> onchange="GRID.checkbox.sync(this, this.checked);" />
</td> </td>
<td>{SGG_NM}</td> <td>SGG_NM</td>
<td>{TASK_SE_NM}</td> <td>TASK_SE_NM</td>
<td>{VHRNO}</td> <td>VHRNO</td>
<td>{RPM_SZR_VHRNO}</td> <td>RPM_SZR_VHRNO</td>
<td>{CRDN_YMD_TM}</td> <td>CRDN_YMD_TM</td>
<td>{CRDN_PLC}</td> <td>CRDN_PLC</td>
<td>{GOJI_NO}</td> <td>GOJI_NO</td>
<td>{SUM_AMT}</td> <td>SUM_AMT</td>
<td>{VR_ACTNO}</td> <td>VR_ACTNO</td>
<td>{CRDN_STTS_NM}</td> <td>CRDN_STTS_NM</td>
<td>{RTPYR_NM}</td> <td>RTPYR_NM</td>
<td>{RTPYR_ADDR}</td> <td>RTPYR_ADDR</td>
<td>{RTPYR_DTL_ADDR}</td> <td>RTPYR_DTL_ADDR</td>
</tr> </tr>
</template> </template>
</table> </table>

@ -2,7 +2,7 @@ function newSprt01010Control(page, doctx = ""){
page.ctrl = new IntegrationSearchControl( { page.ctrl = new IntegrationSearchControl( {
dataGetter: obj => Array.isArray(obj) ? obj : [], dataGetter: obj => Array.isArray(obj) ? obj : [],
appendData: false, appendData: false,
keymapper: data => data ? data.CRDN_ID : "", keys: ["CRDN_ID"],
urls: { urls: {
load: wctx.url("/sprt/sprt01/010/list.do") // 검색 load: wctx.url("/sprt/sprt01/010/list.do") // 검색
}, },

Loading…
Cancel
Save