How to make columns Sticky ?

How to make columns Sticky ?

Sanit KaleSanit Kale Posts: 23Questions: 9Answers: 0
edited August 2019 in Free community support

I have tried everything but not able to make columns sticky

           var dataTable = $('#page').DataTable( {
           "processing": true,
       "oLanguage": { "sSearch": "Search:" },
           "bDestroy": true,
            "bPaginate": true,
            "bLengthChange": true ,
            "bFilter": true,
    "bStateSave": true, // 
            "bSort": true,
        "lengthMenu": [[5,10, 25, 50, 100, 200, -1], [5,10, 25, 50, 100,200, "All"]],
            "bInfo": true,
            "bAutoWidth": false,
            "bDeferRender": true,
            "bRetrieve": true,
           " bSelect": true,
        "sAjaxSource":"server.php",
        }); 

I have tried both methods

"fixedColumns": { leftColumns: 3 },

and this also

new $.fn.DataTable.FixedColumns( dataTable, { leftColumns: 2 } );

but nothing is working

any help would be appreciated...!!

Answers

  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394

    When you tried FixedColumns, did you include the FixedColumns extension?

  • colincolin Posts: 15,158Questions: 1Answers: 2,587

    Yep, as @tangerine suggested, it's likely because you're not including the necessary files. If you look at this example here, ensure you have the necessary files listed on the Javascript and CSS tabs beneath the table.

    Cheers,

    Colin

This discussion has been closed.