table.file is not a function
table.file is not a function
NickZhang
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
This discussion has been closed.
Answers
You have to initialize "table" before trying to use it.
Can you try writing dataTable (with a small d)
ty
f
yes, i have try with small 'd', but still have same issue
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