Aybody know the syntax??

Aybody know the syntax??

orchid1orchid1 Posts: 18Questions: 0Answers: 0
edited August 2009 in General
if I want to make a few rows invisable and make a few rows unsortable is this the syntax
[code]
$(document).ready(function() {
$('#example').dataTable( {
"aoColumns": [
{ "bVisible": false },
null,
null,
null,
{ "bVisible": false },
],
"aoColumns": [
{ "bSortable": false },
null,
{ "bSortable": false },
null,
null
]



} );
} );
[/code]

is this code okay
I thought that was the syntax but it fails

any Ideas

Replies

  • allanallan Posts: 63,602Questions: 1Answers: 10,486 Site admin
    Hi,

    The code you posted refers to aoColumns - which is used for columns - not rows :-). Also it is expected that there is only one definition of aoColumns - I'm not sure what would happen if you define it twice - probably a Javascript error.

    Perhaps you are looking for:

    [code]
    $(document).ready(function() {
    $('#example').dataTable( {
    "aoColumns": [
    { "bVisible": false, "bSortable": false },
    null,
    { "bSortable": false },
    null,
    { "bVisible": false },
    ]
    } );
    } );
    [/code]

    If it is actually rows rather than columns you want to make non-sortable and hidden, then I'm afraid you are out of luck. It's possible using the API to do that, but it's a lot more complicated (you would need custom filtering).

    Allan
  • orchid1orchid1 Posts: 18Questions: 0Answers: 0
    thanx allen

    I'm gonna try that
    I come from a AS3 programming background i'm just now learning ajax and jquery

    O' i actually did mean columns Oops.

    I'll try this and post back if it works

    thanx
  • orchid1orchid1 Posts: 18Questions: 0Answers: 0
    it works
    thanks

    I'm using Datatables with server a mysql database and I love it
This discussion has been closed.