JeremyFagis / dropify

Override your input files with style — Demo here : http://jeremyfagis.github.io/dropify
MIT License
974 stars 399 forks source link

how can I change the preview programmatically? #75

Open deevannaveed opened 6 years ago

deevannaveed commented 6 years ago

I want to change the preview programmatically so that I can display the dropify in a modal and it show different preview image for each row ?

PeterTough2 commented 6 years ago

I have tried this but it didn't work let me know if any solution is found.

$('.dropify').dropify({
     defaultFile: 'process/uploads/staff_152192142429093.jpg',
});
pratakr commented 6 years ago

Hi, This code is work for me.

var filedropper = $('#file_machine_front').dropify(); filedropper = filedropper.data('dropify'); filedropper.resetPreview(); filedropper.clearElement(); filedropper.settings['defaultFile'] = 'uploads/image/test.jpg'; filedropper.destroy(); filedropper.init();

dareshiri commented 5 years ago

Hi, This code is work for me.

var filedropper = $('#file_machine_front').dropify(); filedropper = filedropper.data('dropify'); filedropper.resetPreview(); filedropper.clearElement(); filedropper.settings['defaultFile'] = 'uploads/image/test.jpg'; filedropper.destroy(); filedropper.init();

I had tried several ways for two days, none of them did work.. But your solution was helpful.. Thank you very much..