-
-
Save iksela/777686 to your computer and use it in GitHub Desktop.
Display TableTools buttons as JQueryUI buttons with an icon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('#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