문제

Got Datatable to work. Now trying to apply the extra Tabletools (so i can export table to csv).

I can see the export to csv. Am i missing something? I have applied(as suggested)

$(document).ready( function () {
$('#example').dataTable( {
    "sDom": "<'row-fluid'<'span6'T><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
    "oTableTools": {
        "aButtons": [
            "copy",
            "print",
            {
                "sExtends":    "collection",
                "sButtonText": 'Save <span class="caret" />',
                "aButtons":    [ "csv", "xls", "pdf" ]
            }
        ]
    }
    } );
} );

I am using the 'jquery-datatables-rails' gem, which it says it supports table tools.

Thank you

도움이 되었습니까?

해결책

I guess your problem is that you miss the flash-object.

If it is 1.91. Add this to your dataTable{( code (you must realize that the path depends on your setup, so this is just an example)

sSwfPath: "DataTables-1.9.1/extras/TableTools/media/swf/copy_csv_xls_pdf.swf",
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top