Select all CheckBox not working for current page only

Select all CheckBox not working for current page only

jtliviojtlivio Posts: 11Questions: 4Answers: 0

This is working for all pages, I tried to address a table.rows({ page: 'current' }).nodes(); but is not working for the current page.

Kindly provide any solution

 $('#selectAll').change(function () {
    var cells = table.cells().nodes();
    table.rows({ page: 'current' }).nodes();
    $(cells).find(':checkbox').prop('checked', $(this).is(':checked'));
    if ($(this).is(':checked')) {
      that.setState({ buttstate: false });
    }
    else {
      that.setState({ buttstate: true });
    }
});

Answers

  • jtliviojtlivio Posts: 11Questions: 4Answers: 0

    Upsss I'm an idiot

     $('#selectAll').change(function () {
            var cells = table.rows({ page: 'current' }).nodes();
            
            $(cells).find(':checkbox').prop('checked', $(this).is(':checked'));
            if ($(this).is(':checked')) {
              that.setState({ buttstate: false });
            }
            else {
              that.setState({ buttstate: true });
            }
          });
    

    Thanks

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    We've all been there! :)

    Colin

Sign In or Register to comment.