سؤال

I was trying to implement generate Excel from jQuery datatable. The icons in the flash video were in disabled state except print option. What could be the issue?

<style type="text/css" media="screen">  

@import "/public/stylesheets/TableTools.css";

    .dataTables_info { padding-top: 0; }
    .dataTables_paginate { padding-top: 0; }
    .css_right { float: right; }
    #example_wrapper .fg-toolbar { font-size: 0.8em }
    #theme_links span { float: left; padding: 2px 10px; }

</style>
<script>
    $(document).ready( function() {
        oTable = $('#example').dataTable({
                    "sDom": 'T<"clear">lfrtip',
                    "oTableTools": {
                        "sSwfPath": "/public/swf/copy_cvs_xls_pdf.swf"
                },
                    "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]]
}
            );
});
هل كانت مفيدة؟

المحلول 2

Upgrade the datatables and TableTools it's working fine.

نصائح أخرى

This issue is usually caused by the fact that the flash component is not loaded correctly. You should set the path manually like this:

$('#example').dataTable( {
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
        "sSwfPath": "/swf/copy_cvs_xls_pdf.swf"
    }
} );
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top