From 8215b596fee1c346c046150ce7e806d11483852e Mon Sep 17 00:00:00 2001 From: eastargh Date: Fri, 31 Jul 2026 13:58:32 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=EC=8B=9C=20numeric=EC=B9=BC=EB=9F=BC=20?= =?UTF-8?q?=EC=88=AB=EC=9E=90=EB=A7=8C=20=EC=9E=85=EB=A0=A5=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20validation=20&=20focus=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsp/onl/admin/rule/layoutManDetail.jsp | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/WebContent/jsp/onl/admin/rule/layoutManDetail.jsp b/WebContent/jsp/onl/admin/rule/layoutManDetail.jsp index e920ea0..4064484 100644 --- a/WebContent/jsp/onl/admin/rule/layoutManDetail.jsp +++ b/WebContent/jsp/onl/admin/rule/layoutManDetail.jsp @@ -76,13 +76,13 @@ columns = [ // for columnData prop { title: '<%= localeMessage.getString("layoutMan.itemDesc") %>', name: 'loutItemDesc', type: 'text', width:280, resize:true, minWidth:120 }, { title: '<%= localeMessage.getString("layoutMan.itmeEn") %>', name: 'loutItemName', type: 'text', width:280, resize:true, minWidth:120 }, - { title: '<%=localeMessage.getString("standardLayout.itemLevel")%>', name: 'loutItemDepth', type: 'text', width:50 }, + { title: '<%=localeMessage.getString("standardLayout.itemLevel")%>', name: 'loutItemDepth', type: 'numeric', width:50 }, { title: '<%= localeMessage.getString("standardLayout.itemType") %>', name: 'loutItemType', type: 'autocomplete', source: itemTypes, width:70 }, { title: '<%= localeMessage.getString("standardLayout.arraySize") %>', name: 'loutItemOccCnt', type: 'text', width:90 }, { title: '<%= localeMessage.getString("standardLayout.refField") %>', name: 'loutItemOccRef', type: 'text', width:90 }, { title: '<%=localeMessage.getString("layoutMan.dataType")%>', name: 'loutItemDataType', type: 'autocomplete', source: basicDataTypes, width:160 }, { title: '<%=localeMessage.getString("layoutMan.dataLen")%>', name: 'loutItemLength', type: 'numeric', width: 70, align: 'center' }, - { title: '<%=localeMessage.getString("layoutMan.decpLen")%>', name: 'loutItemDecimal', type: 'text', width: 70 }, + { title: '<%=localeMessage.getString("layoutMan.decpLen")%>', name: 'loutItemDecimal', type: 'numeric', width: 70 }, { title: '<%=localeMessage.getString("layoutMan.defaultVal")%>', name: 'loutItemDefault', type: 'text', width: 70 }, { title: '<%=localeMessage.getString("layoutMan.mask")%>', name: 'loutItemMaskYn', type: 'checkbox', width: 70 }, { title: '<%=localeMessage.getString("layoutMan.moffset")%>', name: 'loutItemMaskOffset', type: 'text', width: 50 }, @@ -182,6 +182,41 @@ $('#dataTotalLen').text(totalLen); } + function focusGridCell(colIndex, rowIndex) { + var cellName = jexcel.getColumnNameFromId([colIndex, rowIndex]); + var cell = grid.getCell(cellName); + grid.updateSelection(cell); + cell.scrollIntoView({block: 'center', inline: 'center'}); + grid.openEditor(cell, false); + } + + var INTEGER_REGEXP = /^(0|[1-9][0-9]*)$/; + + function validateNumberColumns() { + var data = grid.getData(); + var gridColumns = grid.options.columns; + + for (var col = 0; col < gridColumns.length; col++) { + if (gridColumns[col].type !== 'numeric') { + continue; + } + + for (var row = 0; row < data.length; row++) { + var value = data[row][col]; + if (value == null) { + continue; + } + value = $.trim(String(value)); + if (value !== '' && !INTEGER_REGEXP.test(value)) { + alert("숫자만 입력할 수 있습니다."); + focusGridCell(col, row); + return false; + } + } + } + return true; + } + function detail(key) { if (!isDetail) { return @@ -321,6 +356,10 @@ }); $("#btn_modify").click(function(){ + if (!validateNumberColumns()) { + return; + } + var postData = $('#ajaxForm').serializeArray(); if (isDetail){ postData.push({ name: "cmd" , value:"UPDATE"});