Instantly share code, notes, and snippets.
Created Jan 24, 2020
DataTables Custom toolbar Buttons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
$("#table_id5").DataTable({ | |
dom: '<"toolbar">frtip', | |
initComplete: function () { | |
$("div.toolbar").html('<span style="font-size:12px;font-weight:bold;" class="font-size text-color"><a href="https://caniuse.com/#feat=canvas" target="_blank" rel="noopener noreferrer">Browser support data from Canvas (basic support)</a></span>') | |
}, | |
lengthChange: false, | |
searching: false, | |
ordering: false, | |
info: false, | |
paging: false | |
}); | |
$('#table_id7').DataTable({ | |
lengthChange: false, | |
searching: false, | |
ordering: false, | |
info: false, | |
paging: false, | |
responsive: true, | |
dom: 'Bfrtip', | |
buttons: [{ | |
extend: 'copy', | |
text: 'Copy to clipboard', | |
title: 'Blood tests performed by Luna' | |
}, | |
/*{ | |
extend: 'csv', | |
title: 'Blood tests performed by Luna' | |
}, { | |
extend: 'excel', | |
title: 'Blood tests performed by Luna' | |
}, { | |
extend: 'pdf', | |
title: 'Blood tests performed by Luna' | |
}, */ | |
{ | |
extend: 'print', | |
text: '印刷', | |
title: 'Blood tests performed by Luna', | |
autoPrint: false, | |
messageTop: 'Red blood cell (RBC) level. hemoglobin (Hgb) level. Hematocrit (Hct) value is shown in the table.', | |
messageBottom: 'Data from periodic inspection results.' | |
} | |
], | |
language: { | |
buttons: { | |
copyTitle: 'クリップボードにコピーしました!' | |
} | |
} | |
}); | |
$("#table_id8").DataTable({ | |
lengthChange: false, | |
searching: false, | |
ordering: false, | |
info: false, | |
paging: false | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment