colvis vs buttons
colvis vs buttons
diedeer
Posts: 16Questions: 2Answers: 0
Hi
How may I update my scripts to use buttons in place of colvis.
If I just replace with the syntaxe of your example
topStart: {
buttons: [
{
text: 'My button',
action: function (e, dt, node, config) {
alert('Button activated');
}
nothing works.
A part of my script:
$(document).ready(function() {
$('#datatables').DataTable( {
fixedHeader: true,
layout: { top1Start: 'buttons' },
buttons: [{ extend: "colvis",text: 'Display/Hide columns' }],
responsive: true,
pageLength: 10,
columnDefs:
Best regards.
Didier B.
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
Answers
This example shows using an array to define the buttons. You would do something like this:
Add any additional buttons you want to the array.
Kevin
Hi Didier,
Thanks for your question. As noted in the forum rules, please post a link to a running test case showing the issue so we can offer some help. 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.
Allan
Thank you for theses infos.