기업로그인 > 기본현장시험정보입력 > 공내재하탭 : 그리드 ‘튜브종류’ 명칭, 형식 변경

명칭(‘튜브종류’➡’시험종류’), 형식(text ➡ 콤보박스)
main
유지인 2025-12-09 13:12:19 +09:00
parent fb1e0b34fb
commit 4cb210adb6
2 changed files with 80 additions and 1 deletions

View File

@ -1044,6 +1044,10 @@ public class BasicController {
List<EgovMap> commCode = basicService.selectWebCommCode(params); List<EgovMap> commCode = basicService.selectWebCommCode(params);
model.put("commCode", commCode); model.put("commCode", commCode);
params.put("commCode", "CM017");
List<EgovMap> commCode2 = basicService.selectWebCommCode(params);
model.put("commCode2", commCode2);
params.put("projectCode", oPROJECT_CODE); params.put("projectCode", oPROJECT_CODE);
params.put("holeCode", oHOLE_CODE); params.put("holeCode", oHOLE_CODE);
params.put("viewTabArray", oViewTabArray); params.put("viewTabArray", oViewTabArray);

View File

@ -18,6 +18,30 @@
<script type="text/javascript"> <script type="text/javascript">
var collection; // 그리드의 데이타 객체 var collection; // 그리드의 데이타 객체
var arrTestType = new Array();
function fn_setGridCombo() {
var num = 0;
<c:set var="num" value="0"/>
<c:forEach var="item" items="${commCode2}" varStatus="status">
<c:if test="${item.code == 'CM017'}">
<c:if test="${num == 0}">
arrTestType["${num}"] = {};
arrTestType["${num}"]['code'] = "${item.codeValue}";
arrTestType["${num}"]['label'] = "${item.codeText}";
<c:set var="num" value="${num + 1}"/>
</c:if>
<c:if test="${num != 0}">
arrTestType["${num}"] = {};
arrTestType["${num}"]['code'] = "${item.codeValue}";
arrTestType["${num}"]['label'] = "${item.codeText}";
<c:set var="num" value="${num + 1}"/>
</c:if>
</c:if>
</c:forEach>
}
// Data 저장. // Data 저장.
function fn_save(rUrl) { function fn_save(rUrl) {
@ -535,6 +559,7 @@ function fn_grid_refresh(){
fn_onLoad(); fn_onLoad();
fn_kendoGrid(); fn_kendoGrid();
fn_kendoGridStyle(); fn_kendoGridStyle();
fn_setGridCombo();
fn_setHeaderText(); //기준계 조회 해서 SetHeaderText fn_setHeaderText(); //기준계 조회 해서 SetHeaderText
@ -605,7 +630,15 @@ function fn_grid_refresh(){
dataSource: kictDataSource, dataSource: kictDataSource,
columns: [ columns: [
{ field: "fieldpresCode", title: "시험코드", attributes: { style:"text-align: left" }, template: "<div class='td-data'>#= (fieldpresCode == null) ? '' : fieldpresCode #</div>" }, { field: "fieldpresCode", title: "시험코드", attributes: { style:"text-align: left" }, template: "<div class='td-data'>#= (fieldpresCode == null) ? '' : fieldpresCode #</div>" },
{ field: "fieldpresTubeType", title: "튜브종류", attributes: { style:"text-align: left" }, template: "<div class='td-data'>#= (fieldpresTubeType == null) ? '' : fieldpresTubeType #</div>" }, // { field: "fieldpresTubeType", title: "시험종류", attributes: { style:"text-align: left" }, template: "<div class='td-data'>#= (fieldpresTubeType == null) ? '' : fieldpresTubeType #</div>" },
{
field: "fieldpresTubeType",
title: "시험종류",
width:105,
attributes: { style:"text-align: left" },
editor: comboEditor,
template: "#=getTeacherName((fieldpresTubeType == null) ? ' ' : fieldpresTubeType)#",
},
{ field: "fieldpresInspectedBy", title: "조사자", attributes: { style:"text-align: left" }, template: "<div class='td-data'>#= (fieldpresInspectedBy == null) ? '' : fieldpresInspectedBy #</div>" }, { field: "fieldpresInspectedBy", title: "조사자", attributes: { style:"text-align: left" }, template: "<div class='td-data'>#= (fieldpresInspectedBy == null) ? '' : fieldpresInspectedBy #</div>" },
{ field: "fieldpresCheckedBy", title: "검수자", attributes: { style:"text-align: left" }, template: "<div class='td-data'>#= (fieldpresCheckedBy == null) ? '' : fieldpresCheckedBy #</div>" }, { field: "fieldpresCheckedBy", title: "검수자", attributes: { style:"text-align: left" }, template: "<div class='td-data'>#= (fieldpresCheckedBy == null) ? '' : fieldpresCheckedBy #</div>" },
{ field: "fieldpresDepth", title: "심도(m)", editor: chooseEditor, attributes: { style:"text-align: right" }, template: "<div class='td-data'>#= (fieldpresDepth == null) ? '0' : fieldpresDepth #</div>" }, { field: "fieldpresDepth", title: "심도(m)", editor: chooseEditor, attributes: { style:"text-align: right" }, template: "<div class='td-data'>#= (fieldpresDepth == null) ? '0' : fieldpresDepth #</div>" },
@ -658,6 +691,48 @@ function fn_grid_refresh(){
}); });
} }
// 그리드 콤보박스 에디트
function comboEditor(container, options) {
var data = JSON.parse(JSON.stringify(arrTestType));
kendoJQuery('<input required data-text-field="label" data-value-field="code" name="' + options.field + '" />')
.appendTo(container)
.kendoDropDownList({
dataValueField: "code",
dataTextField: "label",
autoBind: true,
suggest: true,
//optionLabel: "선택",
dataSource: data,
index: 1,
change: function(e) {
selectedValue = e.sender.value();
},
});
}
function getTeacherName(value) {
var data = JSON.parse(JSON.stringify(arrTestType));
var text = "";
if (value == "[object Object]"){
for (var idx = 0, length = data.length; idx < length; idx++)
{
if (data[idx].code === selectedValue) {
text = data[idx].label;
console.log("선택:"+text);
}
}
return text;
} else {
for (var idx = 0, length = data.length; idx < length; idx++)
{
if (data[idx].code === value) {
text = data[idx].label;
console.log("선택:"+text);
}
}
return text;
}
}
</script> </script>
<div id="kictGrid" class="kist-grid kist-grid-scroll-400" data-target="grid"></div> <div id="kictGrid" class="kist-grid kist-grid-scroll-400" data-target="grid"></div>