Change default classes of oClasses object

Change default classes of oClasses object

brianm84brianm84 Posts: 1Questions: 0Answers: 0
edited May 2011 in General
I have seen that it is possible to change the default classes for object (e.g. sStripOdd class applied to odd table rows), but I have not been able to find an example of how this can be done. I currently have the below code to initialize the table.

I am sure it must be something simple, but I have tried a couple different ways, and looked online for an example without luck.

Thanks in advance!

$("#items").dataTable({
"bJQueryUI": true,
"bSortClasses": false,
"bScrollCollapse": true,
"oClasses": { "sStripOdd": "test" },
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [-1] }
]
});

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    This is done prior to initialising the DataTable: http://datatables.net/styling/custom_classes

    [code]
    $.fn.dataTableExt.oJUIClasses.sWrapper = 'whatever';
    [/code]
    for example.

    Allan
This discussion has been closed.