mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
falta cargar thumbail y preview
This commit is contained in:
@ -235,14 +235,24 @@ if(<?php echo $presupuestoEntity->estado_id?>==2){
|
||||
maxFilesize: 5e+7, // Bytes
|
||||
init: function() {
|
||||
thisDropzone = this;
|
||||
$.get('upload.php', function(data) {
|
||||
$.each(data, function(key,value){
|
||||
|
||||
var mockFile = { name: value.name, size: value.size };
|
||||
|
||||
$.ajax({
|
||||
url: "<?= site_url('presupuestos/presupuestocliente/get_files') ?>",
|
||||
type: 'POST',
|
||||
data: { presupuesto_id: <?= $presupuestoEntity->id ?> },
|
||||
|
||||
}).done(function(response) {
|
||||
if(response == null || response == ""){
|
||||
return;
|
||||
}
|
||||
values = JSON.parse(response);
|
||||
for(var i = 0; i < values.length; i++){
|
||||
var mockFile = { name: values[i].name, size: values[i].size };
|
||||
thisDropzone.options.addedfile.call(thisDropzone, mockFile);
|
||||
thisDropzone.options.thumbnail.call(thisDropzone, mockFile, "uploads/"+value.name);
|
||||
});
|
||||
|
||||
thisDropzone.options.thumbnail.call(thisDropzone, mockFile, "uploads/"+values[i].name);
|
||||
thisDropzone.options.complete.call(thisDropzone, mockFile);
|
||||
thisDropzone.options.success.call(thisDropzone, mockFile);
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user