I have this table:
<table id="tbl" border="1">
<thead>
<tr>
<th>Action</th>
<th>Note</th>
</tr>
</thead>
<tbody>
<tr>
<td class="action"><input class="action_1" type="checkbox"></td>
<td>Note1</td>
</tr>
<tr>
<td class="action"><input class="action_2" type="checkbox"></td>
<td>Note2</td>
</tr>
<tr>
<td class="action"><input class="action_3" type="checkbox"></td>
<td>Note3</td>
</tr>
<tr>
<td class="action"><input class="action_4" type="checkbox"></td>
<td>Note4</td>
</tr>
</tbody>
And I need select td with class "action" and set checkbox in 'on'position if it was selected. My js:
$('.action').selectable({
stop:function (event,ui) {
$('input.ui-selected').each(function () {
console.log($(this).attr('class'));
$(this).prop('checked', true);
});
}
});
Fox example, I select rows from 2 to 4, but it checked only first input, beacuse only first input has class "ui-selected". How can I set "ui-selected" to all selected inputs?