Here is my code below:
let colNames = ['ID', 'Image', 'Title', 'Description'];
let colModel = [
{name: 'id', index: 'id', width: 30, editable: true, editoptions: {size: "30", maxlength: "50"}},
{
name: 'image',
index: 'image',
align: 'left',
editable: true,
edittype: 'file',
editoptions: {
multiple: true,
accept: ".jpg,.png,.jpeg",
enctype: "multipart/form-data"
},
width: 210,
align: 'center',
formatter: imageFormatter,
search: false
},
{name: 'image_title', index: 'image_title', width: 150, editable: true, editoptions: {size: "30", maxlength: "50"}},
{name: 'image_description', index: 'image_description', width: 150, editable: true, editoptions: {size: "30", maxlength: "50"}}
}
];
I am using ajaxFileUpload and here is my code to upload the same:
afterSubmit: function (response) {
if(response.responseJSON){
$.ajaxFileUpload({
url: fileuploadUrl,
secureuri:false,
fileElementId:'image',
dataType: 'json',
success: function (data, status) {
alert("Upload Complete.");
}
});
}
return [true];
}
},
This fileElementId
is referring to image
. Where image
is picked only once. Tried assigning image to images[]
as we do it from plain HTML. But still no luck as ajaxFileUpload.js throwing error as id not found with images[]
.