Customized Buttons using Flash doesn't work - only printing works???
Customized Buttons using Flash doesn't work - only printing works???
MichaelLand
Posts: 26Questions: 0Answers: 0
Hello, I have installed installed Adobe Flash into my development environment and tested DataTable examples considering customized buttons online and they seems to work. But when I try to do it in my code it does not work. I have checked Online Samples code using View Source but noticed nothing.
I have tried both Copy to Clipboard and PDF file creating but nothing works. Like you see code below I use Customized buttons because I want to localize them. Printing works well but I have understood that it is only part that does not use Flash.
I include following files
TableTools.css
jquery.dataTables.js
TableTools.js
ZeroClipboard.js
and get no error messages.
What could be wrong, thanks
Michael
// I'm using DataTables-1.9.0 and it's TableTools
$(document).ready(function () {
var datatable = $('#GeneratedReport').dataTable({
"iDisplayLength": 25,
"aLengthMenu": [[25, 50, 100, 500, 1000, 5000, -1], [25, 50, 100, 500, 1000, 5000, 'All']],
"aaSorting": [[0, "asc"]],
"oLanguage": { // Language FI
"sProcessing": "Hetkinen...",
"sLengthMenu": "Näytä kerralla _MENU_ riviä",
"sZeroRecords": "Tietoja ei löytynyt",
"sInfo": "Näytetään rivit _START_ - _END_ (yhteensä _TOTAL_ )",
"sInfoEmpty": "Näytetään 0 - 0 (yhteensä 0)",
"sInfoFiltered": "(suodatettu _MAX_ tuloksen joukosta)",
"sInfoPostFix": "",
"sSearch": "Etsi:",
"sUrl": "",
"oPaginate": { "sFirst": "Ensimmäinen", "sPrevious": "Edellinen ", "sNext": "Seuraava ", "sLast": "Viimeinen" },
"aoColumns": [
null, null, null, null, null, null, null, null, null, { "bSortable": false }
]
},
"sDom": 'l<"H"frT>t<"F"ip>',
"oTableTools": {
"aButtons": [ // !!!! Localized buttons !!!!
{
"sExtends": "copy",
"sButtonText": "Kopioi leikepöydälle",
"sToolTip": "Leikepöydälle",
"sInfo": "Kopioidaan taulukkoa leikepöydälle." + "Odota hetki."
},
{
"sExtends": "print",
"sButtonText": "Tulosta",
"sToolTip": "Tulostusnäkymä",
"sInfo": "Tulostusnäkymää muodostetaan." + "Paluu edelliselle näytölle ESC-näppäimellä."
}
]
}
});
});
I have tried both Copy to Clipboard and PDF file creating but nothing works. Like you see code below I use Customized buttons because I want to localize them. Printing works well but I have understood that it is only part that does not use Flash.
I include following files
TableTools.css
jquery.dataTables.js
TableTools.js
ZeroClipboard.js
and get no error messages.
What could be wrong, thanks
Michael
// I'm using DataTables-1.9.0 and it's TableTools
$(document).ready(function () {
var datatable = $('#GeneratedReport').dataTable({
"iDisplayLength": 25,
"aLengthMenu": [[25, 50, 100, 500, 1000, 5000, -1], [25, 50, 100, 500, 1000, 5000, 'All']],
"aaSorting": [[0, "asc"]],
"oLanguage": { // Language FI
"sProcessing": "Hetkinen...",
"sLengthMenu": "Näytä kerralla _MENU_ riviä",
"sZeroRecords": "Tietoja ei löytynyt",
"sInfo": "Näytetään rivit _START_ - _END_ (yhteensä _TOTAL_ )",
"sInfoEmpty": "Näytetään 0 - 0 (yhteensä 0)",
"sInfoFiltered": "(suodatettu _MAX_ tuloksen joukosta)",
"sInfoPostFix": "",
"sSearch": "Etsi:",
"sUrl": "",
"oPaginate": { "sFirst": "Ensimmäinen", "sPrevious": "Edellinen ", "sNext": "Seuraava ", "sLast": "Viimeinen" },
"aoColumns": [
null, null, null, null, null, null, null, null, null, { "bSortable": false }
]
},
"sDom": 'l<"H"frT>t<"F"ip>',
"oTableTools": {
"aButtons": [ // !!!! Localized buttons !!!!
{
"sExtends": "copy",
"sButtonText": "Kopioi leikepöydälle",
"sToolTip": "Leikepöydälle",
"sInfo": "Kopioidaan taulukkoa leikepöydälle." + "Odota hetki."
},
{
"sExtends": "print",
"sButtonText": "Tulosta",
"sToolTip": "Tulostusnäkymä",
"sInfo": "Tulostusnäkymää muodostetaan." + "Paluu edelliselle näytölle ESC-näppäimellä."
}
]
}
});
});
This discussion has been closed.
Replies
Allan
I didn't find any error messages.
I'm running Application in Visual Studio's WebApp.DevServer.
Customized buttons have icons with buttontext defined in code.
But like I mentioned copy, pdf, xls aren't working. Printing works.
When using Customized buttons should .swf file also be defined and loaded?
Michael
Allan
I tried the whole path from WebApplication removing step by step one hierarchy starting from the most highest level like below:
ASP.NET MVC3 WebApplication-Solution
"sSwfPath": "Content/DataTables-1.9.0/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
then
"sSwfPath": DataTables-1.9.0/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
etc.
But the same problem exixts whitout any errors.
Michael
Michael
PS. Adobe Flash Add-On is installed to browser.
GET http://localhost:49246/media/swf/copy_cvs_xls_pdf.swf 404 (Not Found)
So, where copy_cvs_xls_pdf.swf should be placed and configured...
Allan
I created a directory Content under my WebApplication and there I copied
file copy_csv_xls_pdf.swf
BUT in Javascript file where I initialize DataTables Table I configure
variable sSwfPath to tell *MY* Web Application where that Flash file (.swf) is.
So, if file is in Web Application's directory Content I configure sSwfPath like this:
"sSwfPath": "Content/copy_csv_xls_pdf.swf",
Cheers,
Michael