DatasetControl keyMapper 설정 수정

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save