How to add a checkbox to the table header

How to add a checkbox to the table header

auserauser Posts: 2Questions: 0Answers: 0
edited April 2011 in General
Hi,
I am trying to add a checkbox to the table header. I've searched the forum didn't quite find an answer. I am not using a fixed width header.

Here's the code sample:



Javascript:

oTable[uniqSubProdID] = $("#documentTable").dataTable(datatableConfig);
var datatableConfig = {
"aaData": aDataSet,
"aoColumns": [{
"sTitle": "Type",
"sClass": "left",
"sWidth": "20%"
},
{
"sTitle": "Sub Type",
"sClass": "center",
"sWidth": "10%",
"bSortable": false
},
{
"sTitle": "Name",
"sClass": "left",
"sWidth": "20%"
},
{
"sTitle": "Access",
"sClass": "right",
"bSortable": false,
"sWidth": "10%"
}
],
"bPaginate": false,
"bFilter": false,
"bSort": false,
"bAutoWidth": false,
"bLengthChange": true,
"bStateSave": false,
"bProcessing": true,
"fnDrawCallback": tableDrawn
};


If I want to add a checkbox next to the column header Access, how should I go about that?

Thanks!

Replies

  • CloudStrifeCloudStrife Posts: 6Questions: 0Answers: 0
    Define your as you normally would with your 's. Any CSS and content will be preserved. So just stick that checkbox right in the th you need.
  • auserauser Posts: 2Questions: 0Answers: 0
    edited April 2011
    Thank you for the prompt response.
    I've done the following and it worked.

    [code]
    {
    "sTitle": "Access ",
    "sClass": "center",
    "sWidth": "10%",
    "bSortable": false
    }
    [/code]

    Thanks again!
This discussion has been closed.