Skip to content

Instantly share code, notes, and snippets.

@iksela
Created January 13, 2011 10:42
Show Gist options
  • Select an option

  • Save iksela/777686 to your computer and use it in GitHub Desktop.

Select an option

Save iksela/777686 to your computer and use it in GitHub Desktop.
Display TableTools buttons as JQueryUI buttons with an icon
function formatTableToolsButton(node, icon) {
$(node).removeClass('DTTT_button');
$(node).button({icons: {primary: icon}});
$('.DTTT_container').buttonset();
/* Add this part if you're using a DataTable inside an hidden JUI tab. */
$( ".ui-tabs" ).bind( "tabsshow", function(event, ui) {
$('.DTTT_container').buttonset();
});
}
$('#datatables').dataTable({
"bProcessing": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sAjaxSource": 'ajax/datatables.php',
"sDom": '<"H"Tfr>t<"F"ip>',
"oTableTools": {
"sSwfPath": "../res/swf/copy_cvs_xls_pdf.swf",
"aButtons": [
{
"sExtends": "print",
"fnInit": function(node){formatTableToolsButton(node, 'ui-icon-print');}
}
]
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment