Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82433

Hiding column via columnDefs just won't work for me. I feel like I'm losing my mind.

$
0
0

I'm trying to perform a simple column hide via columnDefs, exactly as is shown here in the first example, but for some reason it just won't work for me, and it's driving me a bit insane. It's such a simple thing and no matter what I try I can't get it working.

Does the columnDefs setting sometimes conflict with another setting? Am I missing something obvious here?

            "columnDefs": [
            { "visible": false, "targets": 0 }
            ],

My server-side processing script contains:

$columns = array(
    array( 'db' => 'id', 'dt' => 0 ),
    array( 'db' => 'name', 'dt' => 1 ),
    array( 'db' => 'number_of_servers', 'dt' => 2 )
);

And my HTML is (it's the ID column I'm trying to hide):

        <thead>
        <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Servers</th>
        </tr>
        </thead>

Viewing all articles
Browse latest Browse all 82433

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>