2012-05-28 2 views
0

두 번째 확인란을 선택하면 GridView가 있고 각 행에 두 번째 확인란이 자동으로 선택됩니다. Clent 측 스크립트를 찾고 있어요 ... 당신이 jQuery를 사용하면 각 두 번째 체크 박스의 테이블과 바인드 변경 이벤트를 반복합니다 함수를 작성할 수 있습니다 사용하는 경우GridView에 동일한 행의 다른 확인란이 선택되어 있는지 확인하십시오.

+0

을 시도 도와주세요. –

답변

1

var rows = $("#your table tr:gt(0)"); // skip the header row 

rows.each(function(index) { 
    var lastCheckbox = $("td:nth-child(youlast checkbox cell) input", this); 
    var firstCheckBox=$("td:nth-child(firstCheckboxCellIndex) input", this); 
    $(lastCheckbox).change(function(e) { $(firstCheckBox).attr('checked',$(this).is(':checked')); 
});; 
+0

안녕하세요 저는이 코드를 chnaged했습니다. $ (document) .ready (function() { var rows = $ ("# GrdMenuConfig tr : gt (0)"); rows.each (function) { var lastCheckbox = $ ("td : nth-child (4) input", this); var firstCheckBox = $ ("td : nth-child (3) input", this); $ (lastCheckbox) { }); }); { $ (firstCheckBox) .attr ('checked', $ (this)); 하지만 작동하지 않습니다 ... !! – Nikhil

관련 문제