feat: 지층면에서 USCS코드로 TAB키 눌렀을때 전환(다음칸으로 이동) 되도록 개선

main
thkim 2025-07-08 16:10:50 +09:00
parent a3aade3a03
commit ea171f199f
2 changed files with 23 additions and 6 deletions

View File

@ -478,7 +478,7 @@ function fn_grid_refresh(){
{ {
field: "layerEngName", field: "layerEngName",
title: "지층명", width:120, title: "지층명", width:120,
attributes: { "class": "teacherName", style:"text-align: left" }, attributes: { "class": "teacherName", style:"text-align: left"},
editor: comboEditor, editor: comboEditor,
//template: "#=layerEngName.label#", //template: "#=layerEngName.label#",
template: "#=getTeacherName((layerEngName == null) ? ' ' : layerEngName)#", template: "#=getTeacherName((layerEngName == null) ? ' ' : layerEngName)#",
@ -504,7 +504,7 @@ function fn_grid_refresh(){
title: "현장기술", title: "현장기술",
attributes: { style:"text-align: left" }, attributes: { style:"text-align: left" },
editor: textareaEditor, editor: textareaEditor,
template: "<div class='td-data td-data-textarea'>#= (layerDesc == null) ? ' ' : layerDesc #</div>" template: "<div class='td-data td-data-textarea' >#= (layerDesc == null) ? ' ' : layerDesc #</div>"
}, },
], ],
scrollable: true, scrollable: true,
@ -561,7 +561,7 @@ function fn_grid_refresh(){
} }
function textareaEditor(container, options) { function textareaEditor(container, options) {
kendoJQuery('<textarea class="td-textarea" name="' + options.field + '" data-bind="value: ' + options.field + '"></textarea>').appendTo(container); kendoJQuery('<textarea class="td-textarea" tabindex="5" name="' + options.field + '" data-bind="value: ' + options.field + '"></textarea>').appendTo(container);
}; };
// 콤보박스 value = [object Object]일때 셀렉트(selectedValue) 값 넘기기 // 콤보박스 value = [object Object]일때 셀렉트(selectedValue) 값 넘기기
@ -573,7 +573,7 @@ function fn_grid_refresh(){
// 그리드 콤보박스 에디트 // 그리드 콤보박스 에디트
function comboEditor(container, options) { function comboEditor(container, options) {
var data = JSON.parse(JSON.stringify(arrLayerEng)); var data = JSON.parse(JSON.stringify(arrLayerEng));
kendoJQuery('<input required data-text-field="label" data-value-field="code" name="' + options.field + '"/>') var myComboEditor = kendoJQuery('<input required data-text-field="label" data-value-field="code" name="' + options.field + '"/>')
.appendTo(container) .appendTo(container)
.kendoDropDownList({ .kendoDropDownList({
dataValueField: "code", dataValueField: "code",
@ -587,9 +587,13 @@ function fn_grid_refresh(){
selectedValue = this.value(); selectedValue = this.value();
fn_selectedValue(selectedValue); fn_selectedValue(selectedValue);
}, },
height: 300 height: 500
}); });
var dropDownListWidget = myComboEditor.data("kendoDropDownList");
dropDownListWidget.wrapper.attr("tabindex", 3);
} }
function getTeacherName(value) { function getTeacherName(value) {
var data = JSON.parse(JSON.stringify(arrLayerEng)); var data = JSON.parse(JSON.stringify(arrLayerEng));
@ -620,8 +624,9 @@ function fn_grid_refresh(){
// 그리드 콤보박스 에디트 // 그리드 콤보박스 에디트
function comboEditor2(container, options) { function comboEditor2(container, options) {
//container.setAttribute('tabindex', 4);
var data = JSON.parse(JSON.stringify(arrLayerScience)); var data = JSON.parse(JSON.stringify(arrLayerScience));
kendoJQuery('<input required data-text-field="label" data-value-field="code" class="testDropDownList" name="' + options.field + '"/>') var myComboEditor2 = kendoJQuery('<input required data-text-field="label" data-value-field="code" class="testDropDownList" name="' + options.field + '"/>')
.appendTo(container) .appendTo(container)
.kendoDropDownList({ .kendoDropDownList({
dataValueField: "code", dataValueField: "code",
@ -638,6 +643,9 @@ function fn_grid_refresh(){
}); });
var dropdownlist = $(".testDropDownList").data("kendoDropDownList"); var dropdownlist = $(".testDropDownList").data("kendoDropDownList");
var dropDownListWidget = myComboEditor2.data("kendoDropDownList");
dropDownListWidget.wrapper.attr("tabindex", 4);
} }
function getTeacherName2(value) { function getTeacherName2(value) {

View File

@ -845,6 +845,13 @@ function fn_tabKendo(e, grid, fromToRow) {
} }
var field = $(e.target)[0].name; var field = $(e.target)[0].name;
var value = $(e.target).val(); var value = $(e.target).val();
if( !field ) {
field = $(e.target)[0].childNodes[1].name;
if( String(value).trim() === "" ) {
value = $(e.target)[0].childNodes[1].value;
}
}
dataItem.set(field, value); dataItem.set(field, value);
if (row >= 0 && row < currentNumberOfItems && col >= 0 && col < nowColCount) { if (row >= 0 && row < currentNumberOfItems && col >= 0 && col < nowColCount) {
@ -867,6 +874,7 @@ function fn_tabKendo(e, grid, fromToRow) {
return; return;
} }
// 변경이 완료되면 셀을 닫고 그리드가 다시 바인딩될때까지 기다림 // 변경이 완료되면 셀을 닫고 그리드가 다시 바인딩될때까지 기다림
if(!grid.tbody.find("tr:eq(" + nextCellRow + ") td:eq(" + nextCellCol + ")").is('.noneditable')){ if(!grid.tbody.find("tr:eq(" + nextCellRow + ") td:eq(" + nextCellCol + ")").is('.noneditable')){
// setTimeout(function() { // setTimeout(function() {
@ -875,6 +883,7 @@ function fn_tabKendo(e, grid, fromToRow) {
// }); // });
grid.editCell(grid.tbody.find("tr:eq(" + nextCellRow + ") td:eq(" + nextCellCol + ")")); grid.editCell(grid.tbody.find("tr:eq(" + nextCellRow + ") td:eq(" + nextCellCol + ")"));
grid.tbody.find("tr:eq(" + nextCellRow + ") td:eq(" + nextCellCol + ")").select(); grid.tbody.find("tr:eq(" + nextCellRow + ") td:eq(" + nextCellCol + ")").select();
} else { } else {
while(grid.tbody.find("tr:eq(" + nextCellRow + ") td:eq(" + nextCellCol + ")").is('.noneditable')){ while(grid.tbody.find("tr:eq(" + nextCellRow + ") td:eq(" + nextCellCol + ")").is('.noneditable')){
!e.shiftKey ? nextCellCol++ : nextCellCol--; !e.shiftKey ? nextCellCol++ : nextCellCol--;