This commit is contained in:
@@ -76,13 +76,13 @@
|
|||||||
columns = [ // for columnData prop
|
columns = [ // for columnData prop
|
||||||
{ title: '<%= localeMessage.getString("layoutMan.itemDesc") %>', name: 'loutItemDesc', type: 'text', width:280, resize:true, minWidth:120 },
|
{ 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("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.itemType") %>', name: 'loutItemType', type: 'autocomplete', source: itemTypes, width:70 },
|
||||||
{ title: '<%= localeMessage.getString("standardLayout.arraySize") %>', name: 'loutItemOccCnt', type: 'text', width:90 },
|
{ 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("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.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.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.defaultVal")%>', name: 'loutItemDefault', type: 'text', width: 70 },
|
||||||
{ title: '<%=localeMessage.getString("layoutMan.mask")%>', name: 'loutItemMaskYn', type: 'checkbox', width: 70 },
|
{ title: '<%=localeMessage.getString("layoutMan.mask")%>', name: 'loutItemMaskYn', type: 'checkbox', width: 70 },
|
||||||
{ title: '<%=localeMessage.getString("layoutMan.moffset")%>', name: 'loutItemMaskOffset', type: 'text', width: 50 },
|
{ title: '<%=localeMessage.getString("layoutMan.moffset")%>', name: 'loutItemMaskOffset', type: 'text', width: 50 },
|
||||||
@@ -182,6 +182,41 @@
|
|||||||
$('#dataTotalLen').text(totalLen);
|
$('#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) {
|
function detail(key) {
|
||||||
if (!isDetail) {
|
if (!isDetail) {
|
||||||
return
|
return
|
||||||
@@ -321,6 +356,10 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#btn_modify").click(function(){
|
$("#btn_modify").click(function(){
|
||||||
|
if (!validateNumberColumns()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var postData = $('#ajaxForm').serializeArray();
|
var postData = $('#ajaxForm').serializeArray();
|
||||||
if (isDetail){
|
if (isDetail){
|
||||||
postData.push({ name: "cmd" , value:"UPDATE"});
|
postData.push({ name: "cmd" , value:"UPDATE"});
|
||||||
|
|||||||
Reference in New Issue
Block a user