File Upload - issue with table.file() API
File Upload - issue with table.file() API
fabioberetta
Posts: 74Questions: 23Answers: 4
Hello all,
I am trying to use the plugin for the file upload.
I get an error: TypeError: table.file is not a function.
this is caused by this line:
label: "Photo",
name: "child.photo",
type: "upload",
display: function ( file_id ) {
return '<img src="'+table.file( 'file', file_id ).web_path+'"/>';
},
and
{ data: "photo",
render: function ( file_id ) {
return file_id ?
'<img src="'+table.file( 'file', file_id ).web_path+'"/>' :
null;
},
defaultContent: "No image",
title: "Image"
},
I do not see what I am doing wrong. Can you help?
ty
f
This question has accepted answers - jump to:
This discussion has been closed.
Answers
I manage to fix this issue. I was just supplying the wrong field...
Now... the plugin is filling the file table properly but no fiile is uploaded and the image_id is not fed to the final table...
any hint?
ty
f
Finally I manage to work it out.
It was a matter of using
instead of dataTable...
Hi,
Good to hear you've got it sorted out now :-)
Allan