Add multiple features to Datatable script in HTML

Add multiple features to Datatable script in HTML

adferns09adferns09 Posts: 1Questions: 1Answers: 0

I cannot seem to figure out how to add multiple features to the DataTable. I have create a table with individual column searching (using select inputs) in the bottom: http://codepen.io/adrianf09/pen/pjVMQz

I would also like to add additional features to it. I have gone through the forum and tried similar threads, however I am unable to do so correct. I would really appreciate all the help.

I am trying to add the follow to the script to remove the sorting for a column:
js "columnDefs": [ { "targets": [ 4 ], "sorting": false } ]

Answers

  • aaronwaaronw Posts: 89Questions: 3Answers: 4
        $('#example').DataTable( {
            initComplete: function () {
                this.api().columns().every( function () {
    

    On a separate line right before initComplete:

    "columnDefs":[{
    "targets":4,
    "sorting":false
    }],
    

    initComplete and columnDefs are both options that you are passing into the DT init object. You put the columnDefs in as a separate function outside of that scope, so nothing is going to look at it.

This discussion has been closed.