table.file is not a function

table.file is not a function

NickZhangNickZhang Posts: 11Questions: 7Answers: 0

I have include upload css and js and add below code ,and got "table.file is not a function" error, can you help with this ?

editor.upload.css"
editor.upload.js

  Code:
var editor;
            jQuery(document).ready(function() {
                 editor = new jQuery.fn.DataTable.Editor( {

                                 .....
                                 "fields": [    {

                                         },

                                         {
                                label: "Image:",
                                name: "image",
                                type: "upload",
                                display: function ( file_id ) {
                                    return '<img src="'+table.file( 'files', file_id ).web_path+'"/>';
                                },
                                clearText: "Clear",
                                noImageText: 'No image'
                            },  







var table=jQuery('#entityTable').DataTable( {
                    "processing": true,
                    "serverSide": true,
                    "initComplete": function () {

This question has an accepted answers - jump to answer

Answers

  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394

    You have to initialize "table" before trying to use it.

  • fabioberettafabioberetta Posts: 74Questions: 23Answers: 4

    Can you try writing dataTable (with a small d)

    editor = new jQuery.fn.dataTable.Editor( {
    

    ty
    f

  • NickZhangNickZhang Posts: 11Questions: 7Answers: 0

    yes, i have try with small 'd', but still have same issue

  • allanallan Posts: 61,795Questions: 1Answers: 10,115 Site admin
    Answer ✓

    Are you using Editor 1.5? The file() method is part of the augmentations that Editor 1.5+ make to the DataTables API. You will get the error you are using with Editor 1.4 and earlier.

    Regards,
    Allan

This discussion has been closed.