Git Product home page Git Product logo

exportable's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

exportable's Issues

lmZzwjnQrq:749 Uncaught TypeError: datatable.exportable.toCSV is not a function

I am getting the error Uncaught TypeError: datatable.exportable.toCSV is not a function when trying to export a table using the CSV export option. The code that I am using is as below;

<script src="https://unpkg.com/vanilla-datatables@latest/dist/vanilla-dataTables.min.js" type="text/javascript"></script>
<script src="https://unpkg.com/vanilla-datatables-exportable@latest/datatable.exportable.min.js" type="text/javascript"></script>
<script>
    var datatable = new DataTable("table", {
        exportable: {
            type:'csv',
            download:true,
            escapeHTML: true,
            includeHeadings: true
        }
    });

    $(document).on('click', '#csvExport', function(){
        datatable.exportable.toCSV();
    });
</script>

No idea how to make this work

Cannot read property 'toCSV' of undefined

<button type="button" class="btn btn-sm btn-primary ml-2" onclick="csvExport()">CSV</button>

              <script>
                  var datatable = new simpleDatatables.DataTable("table", {
                      exportable: {
                          type:'csv',
                          download:true,
                          escapeHTML: true,
                          includeHeadings: true
                      }
                  });
                
                  function csvExport() {
                    datatable.exportable.toCSV();
                  }
              </script>

Please provide some sample code on how to make this work using https://github.com/fiduswriter/Simple-DataTables

Couple of Requests

Just started using and noticed it was new, have a couple of feature requests;

  • Is there any way to ensure that all data exported is stripped of HTML tags and just content is exported? href links and styles are being pulled out the table into the CSV and it would be good to stop it.

  • Can you add a setting to have the first row as the table headings in the table, currently only the table rows are pulled out not the headings.

Great work as always

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.