Customise button text in TableTools

Customise button text in TableTools

trupsstertrupsster Posts: 4Questions: 0Answers: 0
edited May 2011 in TableTools
Hello everyone,

I'm using DataTables and TableTools plugin along with it. It is a fantastic tool and I am definitely making a donation!

I'd really appreciate it if you could help me with my problem. I'm trying to customise the text that appears on the buttons; however, even though I follow your example at http://www.datatables.net/release-datatables/extras/TableTools/button_text.html, I still cannot get it to work. All I get is the default of all 4 buttons (Copy to clipboard, Save as CSV, Save for Excel and Print - the text I can see when only when I hover my mouse on them...). How can I get them to look like how it's shown in the example html above?

Here is a part of my code:

[code]









/* Define two custom functions (asc and desc) for string sorting */
jQuery.fn.dataTableExt.oSort['string-case-asc'] = function(x,y) {
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
};

jQuery.fn.dataTableExt.oSort['string-case-desc'] = function(x,y) {
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
};

$(document).ready(function() {
/* Build the DataTable with third column using custom sort functions */
$('#oclist').dataTable( {
"aaSorting": [ [2,'asc'] ],
"aoColumns": [
null,
null,
{ "sType": 'string-case' }
],
"iDisplayLength": 25,
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"sDom": 'T<"clear"><"top"ilpf<"clear">>rt<"bottom"ip<"clear">>',
"oTableTools": {
"aButtons": [
{
"sExtends": "xls",
"sButtonText": "Export to Excel"
},
{
"sExtends": "copy",
"sButtonText": "Copy to clipboard"
},
{
"sExtends": "print",
"sButtonText": "Print"
}
],
"sSwfPath": "media/swf/ZeroClipboard.swf"

}
}
);
} );
[/code]

Any help would be greatly appreciated! :-)

Thanks,
Trupti

Replies

  • trupsstertrupsster Posts: 4Questions: 0Answers: 0
    Hello again,

    Also, I'd like to know how to retain a hyperlink when the data in a column has one. One of my columns does, and when I save it to excel, only the anchor text is copied, not the hyperlink.

    Thanks!
    Trupti
This discussion has been closed.