기업사용자 입력시스템: 기본 물성시험(함수비, 비중, 액성한계, 소성지수, 단위중량) 입력값 없는(-999)일때 클릭하면 -999가 보임 --> '-' 가 보이는것이 정상임

main
유지인 2026-04-16 16:01:03 +09:00
parent 2bf2ccc2d0
commit f0a6950bc0
2 changed files with 31 additions and 7 deletions

View File

@ -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 },
}

View File

@ -52,8 +52,12 @@ function numericEditor(container, options, isHyphenAllowed = false) {
function numericEditor2(container, options, isHyphenAllowed = false) {
var input = kendoJQuery('<input type="test" name="' + options.field + '" class="k-textbox" style="width:100%; text-align:right;" />');
let rawVal = options.model[options.field];
if (rawVal === -999) {
options.model.set(options.field, null);
rawVal = null;
}
var input = kendoJQuery('<input type="text" name="' + options.field + '" data-bind="value:' + options.field + '" class="k-textbox" style="width:100%; text-align:right;" />');
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) {