Delete all buttons in a collection of buttons
Delete all buttons in a collection of buttons

in Buttons
I would like to delete the buttons MISSING and NEW without addressing it separately. Is there anything like removeAll()?
buttons: [
{
extend: 'collection',
autoClose: true,
text: 'Status',
buttons: [
{
text: 'MISSING',
className: 'active',
attr: {id: 'statusBtnMissing'}
},
{
text: 'NEW',
attr: {id: 'statusBtnNew'},
}
]
},
],
This question has an accepted answers - jump to answer
Answers
There is not a
removeAll()
. But you can choose multiple buttons usingbutton-selector
and usebuttons().remove()
to remove multiple buttons with one statement.EDIT: Using
buttons()
with no selector will select all the buttons.Kevin
Thanks, Kevin!