私は FlexiGrid に取り組んでおり、スクリプトに関する問題はほとんどありません。FlexiGrid を正常に作成し、それにチェックボックスを追加しました。チェックボックスをクリックすると、目的の行を選択したい。任意の行をクリックすると、class='trSelected' が設定され<tr id="row101" class="trSelected">
ます。チェックボックスのクリックを設定するスクリプトをいくつか試しましたが、機能しません。この問題を解決する方法を教えてください。
<script type="text/javascript">
function checkedCall() {
if( $('#checkNote').is(':checked')){
//$("#tblflex > tr:first").addClass("trSelected");
//$(this).parents('tr:first').addClass('trSelected');
alert('Selected' + $(this).parents('tr:first').attr('id')); //unable to find the ID
}else{
alert('NOTSelected');
//$("#tblflex > tr:first").removeClass("trSelected");
//$(this).parents('tr:first').removeClass('trSelected');
}
}
HTML コード:
<table id="tblflex" class="flexCLS" style="display: table;" border="0">
<tbody>
<tr id="row101">
<td align="left">
<div style="text-align: left; width: 40px;">
<input type="checkbox" id="checkNote" onclick="checkedCall();">
</div>
</td>
</tr>
<tr id="row187">
<td align="left">
<div style="text-align: left; width: 40px;">
<input type="checkbox" id="checkNote" onclick="checkedCall();">
</div>
</td>
</tr>
ありがとう!