Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

columnDefs not working with bStateSave = ture

$
0
0

Hi friends
I have datetable with columnDefs to hide few coulmns by default, it is working fine
but when I make bStateSave:true then no coulmns are hidden

       var table = $('.dt').DataTable({
        orderCellsTop: true,
        fixedHeader: true,
        "order": [],
        "pageLength": 10,

    // "bStateSave":true,
        // "stateSaveParams": function (settings, data) {
        //     data.start = 0;
        //     data.search.search = "";
        //     $.each(data.columns,function(i,v){
        //         //prevent column level searching 
        //         v.search.search = "";
        //     });
        // },

        dom:"<'row'<'col-sm-3'l><'col-sm-6 text-center'B><'col-sm-3'f>>" +
                "<'row'<'col-sm-12'tr>>" +
                "<'row'<'col-sm-5'i><'col-sm-7'p>>",
        "columnDefs": [
                                  { "visible": false, "targets": 1 }, 
                                  { "visible": false, "targets": 2 }, 
                                  { "visible": false, "targets": 3 }, 
                                  { "visible": false, "targets": 4 }, 
                        ],  

Viewing all articles
Browse latest Browse all 2364

Trending Articles