set select = false onclick

set select = false onclick

Ghost108Ghost108 Posts: 19Questions: 7Answers: 0
edited January 2022 in Free community support

Hi all !

I have this datatables config:

var table = $('#table').DataTa
  select: {
      selector: 'td:first-child',
      style: 'multi'
  }
});

Is there a way to set select = false with a button onclick function ?

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    Yep, you can do something like this:

        table.select.items(toggle? 'none' : 'rows');
    

    It's using an undocumented feature of select.items() - setting the selection type to unsupported type, which just disables the selection!

    Colin

Sign In or Register to comment.