I am using the following library https://github.com/blueimp/jQuery-File-Upload/wiki
I am showing the selected files after (add files) button is selected. I am not showing the demo grid showing cancel button or upload
I have a button which does the submit (see below). I would like to cancel the upload of one of the files selected before this upload button is selected.
Walking through the code i see that when i finally hit submit, it calls fileuploadsubmit for each file uploaded.
I would like to show to the user grid of files selected, then allow them to cancel one of them by picking a link to remove from data. All the samples i am finding online tend to parent().remove() thereby removing from visual grid.
How can i do without showing that grid?
ie..
...
add: function (e, data) {
$.each(data.files, function (index, file) {
files += file.name;
});
$('#files').text(files);
viewModel.Add(data);
data.context = $('#btnUpload')
.click(function () {
data.submit();
return false;
});
},
......
$('#fileupload').bind('fileuploadsubmit', function (e, data) {
// The example input, doesn't have to be part of the upload form:
//var input = $('#input');
//data.formData = {example: input.val()};
var countryId = 1; //viewModel.selectedCountry().CountryId()
var selected = 'test'; //$('#lstTemplate option:selected').text();
data.formData = { templateType: selected, countryId: countryId };
if (data.formData.templateType == 'Select') {
data.context.find('button').prop('disabled', false);
return false;
}
});