Hide column not working

Hide column not working

hawkmasterhawkmaster Posts: 56Questions: 20Answers: 0
edited February 2019 in Free community support

Hello,
I have just a blank table element.
My columns are made:

var cols = [
    { "mData": "Field1", sTitle: "Field1"},
    { "mData": "Field2", sTitle: "Field2"},
    { "mData": "Field3" , "sTitle": "Field3"},
    { "mData": "Field4" , "sTitle": "Field4"},
    { "mData": "Field5" ,  sTitle: "Field5"},
   
];

Datatable:

data_table = jQuery('#Table_0').DataTable({
        "bJQueryUI": true,
        "bDeferRender": true,
        "bInfo" : false,
        "bSort" : false,
        "bDestroy" : true,
        "bFilter" : false,
        "bPagination" : false,
        "aaData": results,
        "aoColumns": cols,
});

I try to hide column 4 (Field4) with:

'columnDefs': [{
           'targets': 3,
           'searchable':false,
           'visible:' false
        }],

but I always get an error:

TypeError: n[m] is undefined

Any idea why?

best regards
Hawk

Answers

  • colincolin Posts: 15,209Questions: 1Answers: 2,592

    Hi @hawkmaster ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. 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.

    Cheers,

    Colin

This discussion has been closed.