Custom Editor button that's enabled before selecting a row
Custom Editor button that's enabled before selecting a row
jacktrap
Posts: 14Questions: 6Answers: 0
Hello, I've been using the custom buttons in this fashion:
$('#myTable').DataTable( {
buttons: [
{
extend: 'selectedSingle',
text: 'Log selected data',
action: function ( e, dt, button, config ) {
console.log( dt.row( { selected: true } ).data() );
}
}
]
} );
And they're great. But I need one for Creating a new row, but they're always disabled by default. I can't find in the documentation where to have a custom button that's enabled before clicking a row?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @jacktrap ,
It's because you're extending
selectedSingle
, which only activates when a single row is selected. If you remove that line, like here, it's always activated.Cheers,
Colin