Changing sTitle AFTER loading the table

Changing sTitle AFTER loading the table

unlikelyunlikely Posts: 1Questions: 0Answers: 0
edited October 2010 in General
So.. I've got this table that I load fine and I use:

[code]
"aoColumnDefs": [
{ "sTitle": "my header title", "aTargets": [0] },
{ "bVisible": false, "aTargets": [ 2 ] }
],
[/code]

But when I reload the data, i want to change the title of the header to something else.. but I run this code:

[code]
FilterItemsTable.fnReloadAjax("json/Get_EventFilterItems.ashx");
FilterItemsTable.fnDraw();
[/code]

And not sure where I can put the new header name.. ? :S

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    $('#table_id thead th:eq(0).html( 'whatever' ); will do the trick. There is no DataTables API method for this, since it's just a standard DOM thing to do.

    Allan
  • dogmeat78dogmeat78 Posts: 4Questions: 0Answers: 0
    that's exactly what I needed.. thanks!
This discussion has been closed.