Column class names

Column class names

xtremer360xtremer360 Posts: 84Questions: 2Answers: 0
edited July 2011 in General
I'm having a little trouble understanding how to accomplish what I'm wanting to do with the modules in my CMS. Each module has a datatable of information for each module with various information. So not all tables will share the same EXACT table structure however there will be 3 TH's of ALL the tables that will be the same. That is the first TH [index of 0] that is a checkbox for marking if you want to edit more than one row. There will also be two other TH's that are called Edit and Delete and have icons for the rows column.

I use the jQuery dataTables plugin.


The page I'm looking at that helps explain some of the information on what I want to do is here.
http://www.datatables.net/usage/columns

As of right now I am using this on my pagination.js file.

[code]
var oTable = $('.dataTablePageList').dataTable( {
"bJQueryUI": true,
"iDisplayLength": 10,
"sPaginationType": "full_numbers"

});
[/code]

What I want to do is figure out how I can have it look to the TH's and IF the TH class is checkbox, edit, or delete then do not allow it to be sortable and have the column heading to be centered along with its content and they can't be searchable of course because they won't have content to be searched, and should have a set column width for each column.

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    You can do that with aoColumnDefs ( http://datatables.net/usage/columns ):

    [code]
    var oTable = $('.dataTablePageList').dataTable( {
    "bJQueryUI": true,
    "iDisplayLength": 10,
    "sPaginationType": "full_numbers"
    "aoColumnDefs": [
    "bSortable": false,
    "aTargets": [ "checkbox", "edit", "delete" ]
    ]
    });
    [/code]

    Allan
This discussion has been closed.