Using the single file package with buttons getting unknown button type: csvHtml5

Using the single file package with buttons getting unknown button type: csvHtml5

Redbaron67Redbaron67 Posts: 6Questions: 1Answers: 0

datatables.js:15867 Uncaught Unknown button type: csvHtml5

                else if ( typeof base === 'string' ) {
                    if ( ! _dtButtons[ base ] ) {
                        throw 'Unknown button type: '+base;
                    }

                    base = _dtButtons[ base ];
                }

Here is my datatables instance:

 $(this.ui.dailyIncome).dataTable({
                "dom":'<"">Bt<"">',
                "buttons":['csvHtml5'],
                "data": data,
                "retrieve": false,
                "paging": false,
                "destroy": true,

I have some other functions after this writing rows, which is going to change as im updating from 1.9.

My understanding is the single file package would contain everything needed, so I only need to load the single javascript file. I don't need the Buttons/Datatables folder when working with the single file package correct?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,356Questions: 1Answers: 10,444 Site admin

    Hi,

    Can you link to the page showing the issue (per the forum rules) please.

    Allan

  • Redbaron67Redbaron67 Posts: 6Questions: 1Answers: 0

    Sorry Allan, unable to link the page. Im working on a local copy, and our upper environments wouldn't contain the new code.

    Is the buttons extension usable on with datatables 1.9.2? Im working on some legacy code that is a mess.

  • Redbaron67Redbaron67 Posts: 6Questions: 1Answers: 0

    Just to follow up, tried to recreate this with a single file and im getting errors with it.

    http://live.datatables.net/pujukami/1/edit?html,js,console,output

    Removing the html5 from the csv still gives no button.

  • Redbaron67Redbaron67 Posts: 6Questions: 1Answers: 0

    Looking into Require.js with 1.10 it seams it was a namespace issue that fixed the csvHTML5 error.

    Now im seeing Uncaught TypeError: Cannot read property 'ext' of undefined:

    which is: jQuery.fn.dataTable.ext.builder = "dt\/dt-1.10.9,b-1.0.3";

  • Redbaron67Redbaron67 Posts: 6Questions: 1Answers: 0

    Stopped trying to use the download builder for a single file. Got it working just using the individual files.

  • allanallan Posts: 63,356Questions: 1Answers: 10,444 Site admin
    Answer ✓

    Is the buttons extension usable on with datatables 1.9.2?

    No. It requires DataTables 1.10.7 or newer.

    The RequieJS error you are seeing with the single file option will be resolve in the next release.

    Allan

This discussion has been closed.