Examples of functioning csv copy pdf print?
Examples of functioning csv copy pdf print?
rendrakobin
Posts: 8Questions: 0Answers: 0
Hello!
First of all, thank you for this wonderful product!
I have a functioning table that utilizes ColReorder and ColVis. I would like to add the copy_csv_xls_pdf functionality. But I am not sure who to combine the javascript correctly. I have tried, but it doesn't seem to work.
Here is the code:
[code]
$(document).ready(function() {
/* Add the events etc before DataTables hides a column */
$("thead input").keyup( function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter( this.value, oTable.oApi._fnVisibleToColumnIndex(
oTable.fnSettings(), $("thead input").index(this) ) );
} );
/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes
*/
$("thead input").each( function (i) {
this.initVal = this.value;
} );
$("thead input").focus( function () {
if ( this.className == "search_init" )
{
this.className = "";
this.value = "";
}
} );
$("thead input").blur( function (i) {
if ( this.value == "" )
{
this.className = "search_init";
this.value = this.initVal;
}
} );
oTable = $('#example').dataTable( {
"sDom": 'RC<"clear">lfrtip',
"aoColumnDefs": [
{ "bVisible": false, "aTargets": [ 2 ] }
],
"oLanguage": {
"sSearch": "Search all columns:"
},
"bSortCellsTop": true
} );
$('#example').dataTable( {
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "../_assets/copy_csv_xls_pdf.swf"
}
} );
} );
[/code]
Thank you in advance for any help! I am a newbie.
First of all, thank you for this wonderful product!
I have a functioning table that utilizes ColReorder and ColVis. I would like to add the copy_csv_xls_pdf functionality. But I am not sure who to combine the javascript correctly. I have tried, but it doesn't seem to work.
Here is the code:
[code]
$(document).ready(function() {
/* Add the events etc before DataTables hides a column */
$("thead input").keyup( function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter( this.value, oTable.oApi._fnVisibleToColumnIndex(
oTable.fnSettings(), $("thead input").index(this) ) );
} );
/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes
*/
$("thead input").each( function (i) {
this.initVal = this.value;
} );
$("thead input").focus( function () {
if ( this.className == "search_init" )
{
this.className = "";
this.value = "";
}
} );
$("thead input").blur( function (i) {
if ( this.value == "" )
{
this.className = "search_init";
this.value = this.initVal;
}
} );
oTable = $('#example').dataTable( {
"sDom": 'RC<"clear">lfrtip',
"aoColumnDefs": [
{ "bVisible": false, "aTargets": [ 2 ] }
],
"oLanguage": {
"sSearch": "Search all columns:"
},
"bSortCellsTop": true
} );
$('#example').dataTable( {
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "../_assets/copy_csv_xls_pdf.swf"
}
} );
} );
[/code]
Thank you in advance for any help! I am a newbie.
This discussion has been closed.
Replies
^here is the datatables debug code
http://live.datatables.net/oneguj/edit#javascript,html