Skip to content

How to add buttons for download csv and excel #262

@pournajar

Description

@pournajar

I utilize datatable-view to show particular data in my django app and it works but I have a problem.
I'd like to show buttons such as csv and excel. So, after importing js and css files of buttons, I add these codes but they don't work.
The function of buttons do not exist in datatable or table variables.
`

var options = {
....
buttons: [
'copy', 'excel', 'pdf', 'csv'
],
sDom: 'Bfrtip'
}//end of defaultDataTableOptions
var datatable = datatableview.initialize($('.datatable'), options);
var table = $('#DataTables_Table_0').DataTable();

datatable.buttons().container().appendTo( $('#buttons', table.table().container() ) );
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions