Changing "create", "edit", and "delete" button class (bootstrap)
Changing "create", "edit", and "delete" button class (bootstrap)
Hi, how do I change these button classes (to btn-btn-info) etc.
(I asked a similar question about within the editor modal a while back, but this time I mean the main editor buttons that are presented with the main table).
I'm calling them like so (not sure if this is still the best way):
// Display the main table buttons
new $.fn.dataTable.Buttons( table, [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
] );
table.buttons().container()
.appendTo( $('.col-sm-6:eq(0)', table.table().container() ) );
} );
I'm able to change the wording of the buttons at the point of initialising editor:
// Customise button and modal wording
i18n: {
create: {
button: "New User",
title: "Create New User",
submit: "Create User"
},
edit: {
button: "Edit User",
title: "Edit User",
submit: "Confirm Changes"
},
remove: {
button: "Delete User",
title: "Delete User",
submit: "Confirm",
confirm: {
_: "Are you sure you wish to delete %d users?",
1: "Are you sure you wish to delete this user?"
}
}
},
but "classname" appears not to take effect in this section..
Many thanks for any tips.
This question has an accepted answers - jump to answer
Answers
I've been able to use something like this before:
{ extend: "create", editor: editor, className: 'btn btn-primary btn-primary-spacing' }
Kevin
Doh! Perfect, thanks!