메뉴 건너뛰기

조회 수 13541 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

 성명

나이

성별 

  홍길동

 23 

 여 

  파파룰라

 25 

 남 

  뽀로로

 12 

 남 

 

◐ Script_Row추가

    function fn_addRow(addData, chkCnt) { 

 if (Number(chkCnt) > 0) {

    var tblObj = $("#testTbl > tbody:last");

    for(var k=0; k<Number(chkCnt); k++) {

        var orw  = $("<tr></tr>");

        var rChk = $("<td><input type='checkbox' name='chkObject' value='"+addData[k].dbKey+"'></td>");

        var rName = $("<td></td>").text(addData[k].name);

        var rAge   = $("<td></td>").text(addData[k].age  );

        var rGender = $("<td></td>").text(addData[k].gender); 

 

          tblObj.append(row);

        row.append(rChk);

        row.append(rName);

        row.append(rAge);

        row.append(rGender);

    }

}

    } 

 

◐ Script_체크된 데이터 Row 삭제 

    function fn_delRow(chkObjNm) { 

         if ($("input[name="+chkObjNm+"]").is(":checked")){ 

            if (confirm("삭제 하시겠습니까?")) { 

                for(var i=$("[name='"+chkObjNm+"']:checked").length-1; i>-1; i--){ 

                    $("[name='"+chkObjNm+"']:checked").eq(i).closest("tr").remove(); 

                } 

            } 

         } else { 

            alert("선택된 데이터가 없습니다.");  

         } 

    } 

   

 

◐ HTML

<table summary="Test" cellpadding="0" cellspacing="0" id="testTbl">

<caption> Test </caption>

<colgroup>

<col width="10%"/>

<col width="30%"/>

<col width="30%"/>

<col width="30%"/>

</colgroup>

<thead>

<th scope="col"><input type="checkbox" onClick="fn_allChecked();" /></th>

<th scope="col">성명</th>

<th scope="col">나이</th>

<th scope="col">성별</th>

</thead>

<tbody>

<c:choose>

<c:when test="${!empty testList}">

<c:forEach begin="0" var="testList" items="${testList}" varStatus="index">

<tr>

    <td></td>

    <td>${testList.testName}</td>

    <td>${testList.testAge}</td>

    <td>${testList.testGender}</td>

</tr>

</c:forEach>

</c:when>

<c:otherwise>

<tr><td colspan="4">검색결과가 없습니다.</td></tr>

</c:otherwise>

</c:choose>

</tbody>

</table>

<div>

<a href="#" onClick="fn_btnChoice()">선택</a>

</div> 

<div> 

 <a href="#" onClick="fn_delRow('chkObject');">삭제</a>

</div> 


  1. 자바 스크립트 confirm()함수에서 (확인,취소) -> (예,아니오)

    Date2014.03.01 Views10215
    Read More
  2. JavaScript 에서 JSON 생성

    Date2016.11.17 Views10323
    Read More
  3. 5초 후에 해당페이지로 url 옮기기

    Date2014.02.27 Views10485
    Read More
  4. 핸드폰 번호 일부 마스킹크 작업 (정규식 이용)

    Date2015.06.19 Views10744
    Read More
  5. 'button', 클릭한 횟수 알아내기!

    Date2015.02.03 Views10763
    Read More
  6. 이벤트 - 페이지 로드 후 이벤트 처리하기 ( window.onload )

    Date2015.06.19 Views10871
    Read More
  7. 자바스크립트 아이디 기억하기 기능 구현 (쿠키저장)

    Date2015.06.19 Views10924
    Read More
  8. 랜덤 배너 노출 스크립트

    Date2019.04.29 Views11067
    Read More
  9. 'Array', 배열 및 다차원 배열 선언에 대해 알아보자!

    Date2015.02.03 Views11110
    Read More
  10. jquery 메뉴 - 아래로 한번에 전체가 펼처짐

    Date2015.04.06 Views11698
    Read More
  11. [jQuery] 실시간 검색어 순위 순서대로 보여주기

    Date2014.03.01 Views12019
    Read More
  12. 창 크기 최대화 시키기

    Date2015.06.19 Views12231
    Read More
  13. 텍스트박스(input type = "text") 숫자 증가, 감소 시키기 - 쇼핑몰 주문 수량

    Date2015.06.19 Views12294
    Read More
  14. GET방식으로 전송시 특수문자함께 전송하는 방법

    Date2016.12.22 Views12350
    Read More
  15. 간단한 동적 SELECT 박스 구현하기

    Date2016.10.06 Views12371
    Read More
  16. input type file multiple list (파일 업로드 리스트 확인)

    Date2016.11.17 Views12442
    Read More
  17. 셀렉트(select) change Ajax 이벤트

    Date2016.12.23 Views12599
    Read More
  18. 라디오버튼 선택 체크여부 radio checked

    Date2014.03.01 Views12671
    Read More
  19. 'focus', 엔터 누르고 이동하자!

    Date2015.02.03 Views12859
    Read More
  20. 선택(CheckBox) 된 Row 삭제 - 화면에서 추가된 Row

    Date2015.04.28 Views13541
    Read More
Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 Next
/ 13

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved