creativetimofficial / ct-argon-dashboard-pro-react

13 stars 7 forks source link

How to show existing images in dropzone component #23

Closed hung1998pro closed 4 years ago

hung1998pro commented 4 years ago

I'm building an edit form for the user to edit the images that they've uploaded but I can not show the Image in your dropzone. image According to the official docs of dropzone displayExistingFiles and some solutions on the StackOverflow but still hopeless. I added these code to init function let mockFile = { name: "avatar.jpg", size: 12345 }; myDropzone.displayExistingFile(mockFile, require('assets/img/samples/avatar.jpg'))

--UPDATE-- I've found that when I remove your previewContainer and previewTemplate, then it works. Here's the picture when I print out the mockFile image Seems like dropzone can not find the class dz-preview, when my dropzone loading the existing images. could you help me find out how to fix this problem

--UPDATE-- I've found the reason why I can not show the existing files because you create preview Template inside the dropzone element image When I move the dz-preview element out of dropzone div then it works. So, how do I solve this problem

einazare commented 4 years ago

Hello there, @hung1998pro ,

We have this covered in our live docs here: https://demos.creative-tim.com/argon-dashboard-pro-react/#/documentation/dropzone

Best, Manu

hung1998pro commented 4 years ago

Hi @EINazare Do you really understand my question, I'm looking for how to show the file that I already uploaded in dropzone to edit that upload ...

einazare commented 4 years ago

Hello there, @hung1998pro ,

Please make me a video with what are you trying to achieve.

Best, Manu