From f0a6950bc0b57d1202a75c331a7d2e7f9cedb037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A0=EC=A7=80=EC=9D=B8?= Date: Thu, 16 Apr 2026 16:01:03 +0900 Subject: [PATCH] =?UTF-8?q?=20=EA=B8=B0=EC=97=85=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=9E=90=20=EC=9E=85=EB=A0=A5=EC=8B=9C=EC=8A=A4=ED=85=9C:=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=EB=AC=BC=EC=84=B1=EC=8B=9C=ED=97=98(?= =?UTF-8?q?=ED=95=A8=EC=88=98=EB=B9=84,=20=EB=B9=84=EC=A4=91,=20=EC=95=A1?= =?UTF-8?q?=EC=84=B1=ED=95=9C=EA=B3=84,=20=EC=86=8C=EC=84=B1=EC=A7=80?= =?UTF-8?q?=EC=88=98,=20=EB=8B=A8=EC=9C=84=EC=A4=91=EB=9F=89)=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=EA=B0=92=20=EC=97=86=EB=8A=94(-999)=EC=9D=BC=EB=95=8C?= =?UTF-8?q?=20=ED=81=B4=EB=A6=AD=ED=95=98=EB=A9=B4=20-999=EA=B0=80=20?= =?UTF-8?q?=EB=B3=B4=EC=9E=84=20-->=20'-'=20=EA=B0=80=20=EB=B3=B4=EC=9D=B4?= =?UTF-8?q?=EB=8A=94=EA=B2=83=EC=9D=B4=20=EC=A0=95=EC=83=81=EC=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/views/web/input/sampleInfo.jsp | 24 +++++++++++++++---- src/main/webapp/kendo-ui/js/common.js | 14 +++++++++-- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/web/input/sampleInfo.jsp b/src/main/webapp/WEB-INF/views/web/input/sampleInfo.jsp index e59bf943..be3837f0 100644 --- a/src/main/webapp/WEB-INF/views/web/input/sampleInfo.jsp +++ b/src/main/webapp/WEB-INF/views/web/input/sampleInfo.jsp @@ -711,6 +711,7 @@ function fn_grid_refresh(){ fn_isMsg(); fn_onLoad(); fn_MakeDataArray(); + fn_ConvertGridData(); // DB에서 값없음(-999); 화면에서 갑없음(-); kendo grid에서 값 없음(null) 처리 fn_kendoGrid(); fn_setGridCombo(); @@ -754,7 +755,20 @@ function fn_grid_refresh(){ }); /* 탭 & 엔터키 이동 끝 */ } + /** + * DB에서 값없음(-999); 화면에서 갑없음(-); kendo grid에서 값 없음(null) 처리 + */ + function fn_ConvertGridData() { + if (!Array.isArray(gridData)) return; + gridData.forEach(item => { + if (item.sampleGs == -999) item.sampleGs = null; + if (item.sampleWc == -999) item.sampleWc = null; + if (item.sampleLl == -999) item.sampleLl = null; + if (item.samplePi == -999) item.samplePi = null; + if (item.sampleRd == -999) item.sampleRd = null; + }); + } function fn_kendoGrid() { var nullTypeString = 'test'; @@ -801,12 +815,12 @@ function fn_grid_refresh(){ sampleDepthTo: { type: "number" }, sampleSamplingMethod: { type: "string" }, sampleShape: { type: "string" }, - sampleWc: { type: "number", defaultValue: "-"}, - sampleGs: { type: "number", defaultValue: "-"}, - sampleLl: { type: "number", defaultValue: "-" }, - samplePi: { type: "number", defaultValue: "-" }, + sampleWc: { type: "number", defaultValue: null}, + sampleGs: { type: "number", defaultValue: null}, + sampleLl: { type: "number", defaultValue: null }, + samplePi: { type: "number", defaultValue: null }, sampleDesc: { type: "string" }, - sampleRd: { type: "number", defaultValue: "-" }, + sampleRd: { type: "number", defaultValue: null }, sampleUscs: { type: "string" }, sampleCode: { type: "string", editable: false }, } diff --git a/src/main/webapp/kendo-ui/js/common.js b/src/main/webapp/kendo-ui/js/common.js index fcb53e2e..34962080 100644 --- a/src/main/webapp/kendo-ui/js/common.js +++ b/src/main/webapp/kendo-ui/js/common.js @@ -52,8 +52,12 @@ function numericEditor(container, options, isHyphenAllowed = false) { function numericEditor2(container, options, isHyphenAllowed = false) { - var input = kendoJQuery(''); - + let rawVal = options.model[options.field]; + if (rawVal === -999) { + options.model.set(options.field, null); + rawVal = null; + } + var input = kendoJQuery(''); input.appendTo(container) .val(options.model[options.field]) @@ -66,6 +70,12 @@ function numericEditor2(container, options, isHyphenAllowed = false) { this.value = val.slice(0, -1); } }) + .on("focus", function () { + if (this.value === "") { + this.value = "-"; + } + this.select(); + }) // 2. ↑ ↓ 키로 값 증가/감소 .on("keydown", function (e) {