Data Tables colvis with save button for show/hide columns

Data Tables colvis with save button for show/hide columns

karamkaram Posts: 31Questions: 14Answers: 0

I am using Datatables 1.10.9 and colvis button plugin can we do something with this plugin such that it updated the table only once after making selection o all columns , like user just hide/show columns by clicking on buttons and somehow save button should update the table only once instead of each time toggling

$(document).ready(function() {
var table;
// DataTable
table = $('#example').dataTable({
"processing": true,
stateSave: true,
"deferRender": true, // to make the search fast

        dom: 'BRlfrtip',

                 buttons: [
                        {  extend: 'colvis',
                            text: 'Change Layout',
                            collectionLayout: 'fixed two-column'
                        }                     
                     ],             "ajax": {
             "url": "/my/example.so",
             "type": "GET"
         },
         "columns": [{
             "title": "name",
             "data": "name",
             "name": "name"
         }, {
             "title": "addeddate",
             "data": "addeddate",
             "name": "added date"
         }]
     });

Answers

  • ty105ty105 Posts: 15Questions: 5Answers: 0

    i am trying to do this as well, so if someone knows a good way, im all ears

This discussion has been closed.