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

Export buttons for tables #428

Open
emlun007 opened this issue Oct 19, 2017 · 5 comments
Open

Export buttons for tables #428

emlun007 opened this issue Oct 19, 2017 · 5 comments

Comments

@emlun007
Copy link
Contributor

I am trying to create an export button that can copy and export the tables as csv, excel and pdf files.

I have loaded following libraries:
https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js
//cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js

and placed following code in layout.html:

{% block script %} {% endblock script %}
<script type="text/javascript">
{% block javascript %} {% endblock javascript %}
  $(document).ready(function(){
      $(".ui.dropdown").dropdown();
      $.getScript('{{url_for('static', filename='js/lists.js')}}')
      $.getScript('{{url_for('static', filename='js/tables.js')}}')
      {% block onload_script %} {% endblock onload_script %}
    })


  $("table:visible").DataTable( {
      dom: 'Bfrtip',
            buttons: [
  
              'copy',
  
              'csv',
  
              'excel',

          'pdf',

              'print',
  
          ]
 

  } );
</script>
{% block head %} {% endblock head %}

I cannot see the export buttons anywhere. What is the wrong in my code ?

@mterzo
Copy link
Contributor

mterzo commented Oct 19, 2017

Post the code as a work in progress merge request. I see lots of things here but hard to give context with out the diff.

@larsnaesbye
Copy link
Contributor

It's in #429 apparently :)

@emlun007
Copy link
Contributor Author

Update: button in #429 works now on Inventory and Catalogs

@emlun007
Copy link
Contributor Author

Update: button in #429 works for all pages. The issue with broken titles is fixed

@gdubicki
Copy link
Contributor

gdubicki commented Feb 5, 2022

Partially implemented - for the Query results - and released in v3.4.0rc2.

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

No branches or pull requests

4 participants