Uncaught TypeError: Cannot set property 'pdfMake'

Uncaught TypeError: Cannot set property 'pdfMake'

lieyongchanglieyongchang Posts: 29Questions: 2Answers: 0
$(document).ready(function() {       
    var myTable = $('#users').DataTable({

            "processing" : true,
            "serverSide" : true,
            "ajax" : {
                "url" : "findall",
                "dataSrc":"",
                "type" : "POST",
                "dataType" : "json",
                "contentType" : "application/json",
                "data" : function(d) {
                    return JSON.stringify(d);
                }
            },
             "columns": [
                {"data": "id"},
                    {"data": "name"},
                    {"data": "age"},
                    {"data": "gender"},
                    {"data": "country"},
                    {"data": "email"},
                    {"data": "mobile"},
                    {"data": "contact"},
                    {"data": "birthdate"},

                    {
                        data: null,
                        className: "center",
                        defaultContent: '<a href="">Edit</a> / <a href="" class="editor_remove">Delete</a>'
                    }  ],
                dom: 'Bfrtip',
                buttons: [
                    'copy', 'excel','pdf','print'
                ]
            });


     }); 

```

I have include all the js file, set dom: 'Bfrtip'

but i am still getting this error message

not sure where i went wrong :(

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    PDFMake is an external library - have you include the source files for that? If you look at this example here, ensure you have the necessary files listed on the Javascript and CSS tabs beneath the table.

    Colin

  • lieyongchanglieyongchang Posts: 29Questions: 2Answers: 0

    I am moving away from the editor path, as I wan to customize my own exporter.

This discussion has been closed.