발주기관 > 건설현장 입력 : 여러 정보 입력시 중간 정보 삭제할 수 있도록 처리
parent
1ba6a9d502
commit
d86ec429a7
|
|
@ -237,8 +237,15 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
|
|||
<span class="unselected-constructor-label-text">건설사 미선정</span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</tr>`;
|
||||
if (tableId > 1) {
|
||||
newTable += `
|
||||
<tr>
|
||||
<td colspan="4" class="bottom-buttons"><button class="btn-left btn-delete" onclick="removeRow(` + tableId + `)" style="margin-bottom: 0;float: right;"> 삭제</button></td>
|
||||
</tr>`;
|
||||
}
|
||||
|
||||
newTable += `</tbody>
|
||||
</table>
|
||||
</div>
|
||||
`;
|
||||
|
|
@ -653,7 +660,7 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
|
|||
}
|
||||
}
|
||||
|
||||
const tableHtml = `
|
||||
var tableHtml = `
|
||||
<div class="table-scrollable" data-index="`+ tableId +`" data-` + tableId + `>
|
||||
<table class="table-bordered table-data" data-index="` + tableId + `">
|
||||
<colgroup>
|
||||
|
|
@ -706,12 +713,21 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
|
|||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td colspan="4" class="bottom-buttons"><button class="btn-left btn-delete" onclick="removeRow(` + tableId + `)" style="margin-bottom: 0;float: right;"> 삭제</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>`
|
||||
;
|
||||
document.getElementById("table-container").insertAdjacentHTML("beforeend", tableHtml);
|
||||
if (document.getElementsByClassName('table-scrollable').length < 1) {addItem()} // 엑셀로 받아오기 중 실패할 경우 삭제한 빈 양식 원복
|
||||
// 첫번째 요소는 삭제하지 않는다.
|
||||
if (document.getElementsByClassName('table-scrollable').length < 2) {$('#table-container > div:first-child tr:last-child').remove()}
|
||||
}
|
||||
|
||||
function removeRow(idx) {
|
||||
$('div[data-index='+ idx +']').remove();
|
||||
}
|
||||
</script>
|
||||
<!-- javascript end-->
|
||||
|
|
|
|||
Loading…
Reference in New Issue