gyrocode/jquery-datatables-checkboxes

[propose] Event trigger after selection set has been changed state

nguyenhaiphan opened this issue · 6 comments

Thank for your great plugin.

Do you have any intention to support event after the selection set has been changed state?

This has already been implemented, see columns.checkboxes.selectCallback for handling event when state of the checkbox changes and columns.checkboxes.selectAllCallback for handling event when state of the "select all" control changes.

Thank you very much

@mpryvkin can you give me a example code on this ?

Yes, I just see the example, but i have another problems,

  1. when the page first load the selectAllCallback is called
  2. If i click on a row checkbox the selectAllCallback is also called

My code:
`
columnDefs: [
{
'targets': 0,
'checkboxes': {
'selectRow': true,
'selectAllCallback': function(nodes, selected, indeterminate){
alert('function is called');
}
},

            }

        ],
        'select': {
            'style': 'multi'
        },`

Here is an example
https://jsfiddle.net/legreco/6wegnxLz/ of this behavior