REMOVE COLUMNS

REMOVE COLUMNS

luanaaluanaa Posts: 2Questions: 0Answers: 0
edited February 2011 in General
I have downloaded datatables,
i read the data from JSON FORMAT:
[code]

$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": 'json_source.txt'
} );
} );

[/code]

but it have 5 columns:
Rendering engine | Browser | Platform(s) | Engine version |CSS grade

i would only 3 columns!!
how can I do?

Replies

  • GregPGregP Posts: 500Questions: 10Answers: 0
    Your number of columns in your HTML should be the same as the number of columns you expect returned to you from the server.

    If you only need 3 columns, I would modify the Ajax source accordingly. I assume you're just prototyping right now and using the included examples, which is why you're loading json_source.txt instead of your own actual data. But if your data will ultimately only have 3 columns, just modify json_source.txt to have only 3 columns, too!

    You could alternatively fart around with hiding columns; in this case you would fetch all 5 but only show 3. It really just depends on what your end goals are.
  • luanaaluanaa Posts: 2Questions: 0Answers: 0
    tnx :)
This discussion has been closed.