Add export buttons to data tables
Change-Id: Ie05c400b0e19107148474a8f8735e83d92235107
diff --git a/js/derekovecs.js b/js/derekovecs.js
index 14792ff..711617e 100644
--- a/js/derekovecs.js
+++ b/js/derekovecs.js
@@ -40,7 +40,13 @@
"bScrollCollapse": true,
"bPaginate": false,
"bJQueryUI": true,
- "dom": '<"top">rt<"bottom"flp><"clear">',
+ "dom": '<"top">rt<"bottom"flpB><"clear">',
+ buttons: [
+ { extend: 'copyHtml5', text: '<i class="fa fa-files-o"></i>', titleAttr: 'Copy' },
+ { extend: 'csvHtml5', text: '<i class="fa fa-file-text-o"></i>', titleAttr: 'CSV', filename: currentWords+'_syn_neighbours' },
+ { extend: 'excelHtml5', text: '<i class="fa fa-file-excel-o"></i>', titleAttr: 'Excel', filename: currentWords+'_sny_neighbours',
+ }
+ ],
"columns": [
{ "data": "rank", type: "allnumeric" },
{ "data": "dist", render: function ( data, type, row ) {return data.toFixed(3) }},
@@ -133,7 +139,13 @@
"bScrollCollapse": true,
"bPaginate": false,
"bJQueryUI": true,
- "dom": '<"top">rt<"bottom"flp><"clear">',
+ "dom": '<"top">rt<"bottom"flpB><"clear">',
+ buttons: [
+ { extend: 'copyHtml5', text: '<i class="fa fa-files-o"></i>', titleAttr: 'Copy' },
+ { extend: 'csvHtml5', text: '<i class="fa fa-file-text-o"></i>', titleAttr: 'CSV', filename: currentWords+'_collocates' },
+ { extend: 'excelHtml5', text: '<i class="fa fa-file-excel-o"></i>', titleAttr: 'Excel', filename: currentWords+'_collocates', exportOptions: { columns: ':visible' } ,
+ }
+ ],
"columns": [
// { "data": "pos", width: "7%", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitvec2window(data, row.heat, row.word) }},
{ "data": "llr", render: function ( data, type, row ) {return toFixed(data, 0) }},