먼저 관심을 가져주셔서 감사합니다.
1. value는 변하고 text는 안변함.
만약에 아래의 소스가 있다면 먼저 1일 디폴트로 선택이 되었고, 기기에서 이값을 2로 바꾸었다면 UI에는 1로 그대로 남아 있고 실행되는 결과를 보면 2로 동작을 했다는 이야기입니다.
<select >
<option value="1">1</option>
<option value="2">2</option>
</select>
2. 다운되는 부분에 대한 소스 부분입니다.
============================
var pri_val = "", html = "", fr_html = "";
for(var i = 1; i < 11; i++) { pri_val += "<option value='" + i + "'>" + i + "</option>"; }
// DOM 초기화
$("#cbi_List > tbody").html("");
for (var i = 0; i < 11; i++) {
fr_html += "<tr>" +
"<td rowspan=\"2\" style=\"background:#90B4C5;text_align:center;\">";
if(i == 0){
fr_html += "<input type=\"checkbox\" name=\"chkBundle\" checked disabled>";
} else {
fr_html += "<input type=\"checkbox\" name=\"chkBundle\">";
}
fr_html += "</td>" +
"<td><input type=\"text\" name=\"bundleContNo\"></td>" +
"<td><input type=\"text\" name=\"bundleContIso\"></td>";
if(i == 0){
fr_html += "<td><select name=\"priority\" style=\"width:100%;\">" + pri_val + "</select></td>";
} else {
fr_html += "<td><select name=\"priority\" style=\"width:100%;\"><option value=''></option>" + pri_val + "</select></td>";
}
fr_html += "</tr>" +
"<tr>" +
"<td>Postup<input type=\"checkbox\" name=\"chkFRStand\"></td>" +
"<td>Fix<input type=\"checkbox\" name=\"chkFRStandFix\"></td>" +
"<td>";
if(GateInMode == "GateIn"){
fr_html += "<section class=\"button\">" +
"<input name=\"btnDMG\" type=\"button\" value=\"DMG\" onclick=\"GateContainerBuildingIn.DamageEdit()\" />" +
"</section>";
}
fr_html += "</td>" +
"</tr>" +
"<tr><td colspan=\"4\" style=\"height:1px;\"></td></tr>";
}
$("#cbi_List > tbody").html(fr_html);
if(GateInMode == "GateIn"){
ContIdx = parseInt($("#inspectionIndex").val());
$("input[name='btnDMG']").first().attr("disabled", "disabled");
} else {
$("input[name='btnDMG']").addClass("hide");
}
$("[name='bundleContNo']:eq(0)").val($("[name='etgPreContNo']:eq(" + ContIdx + ")").val());
$("[name='bundleContIso']:eq(0)").val($("[name='etgPreIso']:eq(" + ContIdx + ")").val());
if(ContIdx == 0){
for(var i = 1; i < bundleNoArry1.length + 1; i++){
bundleInfo = bundleNoArry1[i-1].split("/");
$("[name='bundleContNo']:eq(" + i + ")").val(bundleInfo[0]);
$("[name='bundleContIso']:eq(" + i + ")").val(bundleContIsoArry1[i-1]);
for (var j = 0; j < $("[name='priority']:eq(" + i + ") option").length; j++) {
if (document.getElementsByName("priority")[i].options[j].value == bundlePriorityArry1[i-1]) {
document.getElementsByName("priority")[i].options[j].selected = true;
break;
}
}
if(bundleChkArry1[i-1] == "Y") {
$("[name='chkBundle']:eq(" + i + ")").attr("checked", true);
} else {
$("[name='chkBundle']:eq(" + i + ")").attr("checked", false);
}
if(bundleContFRStandArry1[i-1] == "Y") {
$("[name='chkFRStand']:eq(" + i + ")").attr("checked", true);
} else {
$("[name='chkFRStand']:eq(" + i + ")").attr("checked", false);
}
if(bundleContFRStandFixArry1[i-1] == "Y") {
$("[name='chkFRStandFix']:eq(" + i + ")").attr("checked", true);
} else {
$("[name='chkFRStandFix']:eq(" + i + ")").attr("checked", false);
}
}
} else {
for(var i = 1; i < bundleNoArry2.length + 1; i++){
bundleInfo = bundleNoArry2[i-1].split("/");
$("[name='bundleContNo']:eq(" + i + ")").val(bundleInfo[0]);
$("[name='bundleContIso']:eq(" + i + ")").val(bundleContIsoArry2[i-1]);
for (var j = 0; j < $("[name='priority']:eq(" + i + ")").length; j++) {
if (document.getElementsByName("priority")[i].options[j].value == bundlePriorityArry2[i-1]) {
document.getElementsByName("priority")[i].options[j].selected = true;
break;
}
}
if(bundleChkArry2[i-1] == "Y") {
$("[name='chkBundle']:eq(" + i + ")").attr("checked", true);
} else {
$("[name='chkBundle']:eq(" + i + ")").attr("checked", false);
}
if(bundleContFRStandArry2[i-1] == "Y") {
$("[name='chkFRStand']:eq(" + i + ")").attr("checked", true);
} else {
$("[name='chkFRStand']:eq(" + i + ")").attr("checked", false);
}
if(bundleContFRStandFixArry2[i-1] == "Y") {
$("[name='chkFRStandFix']:eq(" + i + ")").attr("checked", true);
} else {
$("[name='chkFRStandFix']:eq(" + i + ")").attr("checked", false);
}
}
}
if($("#gateIoMode").val() == "I"){
$("#GCB_Save").removeClass("hide");
} else {
$("#GCB_Save").addClass("hide");
}