Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add buttons for download csv and excel #262

Open
pournajar opened this issue Nov 21, 2023 · 0 comments
Open

How to add buttons for download csv and excel #262

pournajar opened this issue Nov 21, 2023 · 0 comments

Comments

@pournajar
Copy link

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() ) );
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant