button dropdown-toggle
button dropdown-toggle
Massimo1974
Posts: 27Questions: 2Answers: 0
I would like to create a place for this button collection a dropdown-toggle do you know how to do ???
this works but only a design problem,
buttons: [
{
extend: 'collection',
className: 'btn btn-outline-warning dropdown-toggle stars',
text: '<span class="btn-label"><i class="fa fa-star" > Preferiti</i></span>',
buttons: [
{
className: 'btn btn-outline-warning',
titleAttr: 'Preferiti',
text: '<span class="btn-label"><i class="fa fa-star" > Solo Preferiti</i></span>',
action: function (dt) {
var table = $('#datatable').DataTable();
table.columns(1).search(1, true, false, true).draw();
$('#pref').parent().addClass("active");
}
},
{
className: 'btn btn-outline-warning',
titleAttr: 'Tutti',
text: '<span class="btn-label"><i class="fa fa-star-half-o" > Tutti</i></span>',
action: function (dt) {
var table = $('#datatable').DataTable();
table.columns(1).search('', true, false, true).draw();
}
},
{
className: 'btn btn-outline-warning',
titleAttr: 'Non Preferiti',
text: '<span class="btn-label"><i class="fa fa-star-o" > Non Preferiti</i></span>',
action: function (dt) {
var table = $('#datatable').DataTable();
table.columns(1).search(0, true, false, true).draw();
}
}
],
},
This discussion has been closed.
Replies
Hi @Massimo1974 ,
I don't understand what you're after, sorry. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
I would like to make a custom dropdown button with these action
Please respond to Colin's post by providing a test case.
cosi ? http://live.datatables.net/yevalamu/1/edit
Your test case is showing seven errors. Check the "console" tab.
I do not have a test done ....
I would like an action button like the bootstrap where at every link I call an action (action: function (e) {
e.preventDefault ();
var table = $ ('# datatable'). DataTable ();
table.rows ({search: 'applied'}) .select ();
}) ....
this https://getbootstrap.com/docs/4.0/components/dropdowns/