Upload Plugin
Upload Plugin
How come I cannot specify extra data to be sent with the upload plugin? I have the following, which works just fine with editor and making edits, etc. When I go to upload a file, I get "No Ajax option specified for upload plug-in" in the browsers console window.
editor = new $.fn.dataTable.Editor({
ajax: {
url: ajax_url,
data: ajax_data
},
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
That looks like it should work. Could you show me your full code?
Thanks,
Allan
Sure. Was too long to paste directly in here.
http://pastie.org/10318658#18
Thanks - got it now!
So the issue is that the upload plug-in will only use the
ajax
parameter if it is a string. If it is not, then it looks for anajax
parameter in the field configuration object (charges.doumentId
in this case). That isn't present in your code, and the combination of these two factors is why the error is occurring.If you add an
ajax
option, basically the same as your object used forajax
that should solve the issue.Regards,
Allan
I think that makes sense now. Was wondering how the editor class would get the extra post information to perform the query correctly. But I guess because the editor upload performs a separate query before hitting 'save' it will not skip the original Ajax defined and error out when running the save query?
To be clear I put something like the following under the field for documentId?
Yes, your description is exactly correct.
But for the
ajax
property - it just attaches straight to the field configuration:Allan