Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 26th, 2012  |  syntax: None  |  size: 1.09 KB  |  hits: 46  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. how to change the content of a header cell in dataTables?
  2. $( oSettings.aoColumns[i].nTh).text();
  3.        
  4. $( oSettings.aoColumns[i].nTh).text("some text");
  5. $( oSettings.aoColumns[i].nTh).html("<a href='#'>some button</a>");
  6.        
  7. "aoColumns": [
  8.     /* Select */    {"bSortable": false },
  9.     /* Type */      {"sClass": "jqmSorter"},
  10.     /* From */      {"bSortable": false },
  11.     /* Status */    {"bSortable": false },
  12. ],
  13.        
  14. "fnHeaderCallback": function( nHead ) {      
  15.        $(nHead).closest('thead').find('.jqmSorter').each( function () {
  16.           var sortTitle = $(this).text(),
  17.           sortButton =
  18.              $( document.createElement( "a" ) ).buttonMarkup({
  19.                   shadow: false,
  20.                   corners: false,
  21.                   theme: 'a',
  22.                   iconpos: "right",
  23.                   icon: "ui-icon-radio-off"
  24.                   })
  25.              sortButton.find('.ui-btn-text').text(sortTitle);
  26.              $(this).html( sortButton )
  27.              sortButton.addClass("colHighTrigger");            
  28.              });
  29.        }
  30.        
  31. $(nRow, '.your_class').html('Your HTML Values');