1

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?

1
  • Any solutions ? Commented Nov 12, 2018 at 9:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.