[Question]: How Do I Hide / Disable Dropzone in AM Modal
See original GitHub issueHello,
I’ve been reviewing the documentation and this link, trying to find the right configuration setting to disable the dropzone in the Asset Manager Modal. In my config, I have set the upload
attribute to 0
, and yet the dropzone still appears, is clickable, displays the system file browser, and allows me to select a file.
I would like to only allow people to select images from a pre-existing library, not upload images, but it is unclear to me how to disable this fully.
Additionally, as a side question- does the Asset Manager handle pagination of files at all? We have a pre-existing media library in our Django app that I can populate the images array with, but that list could be quite long. Breaking it up into categories will help (I’ve seen that you have instructions on how to do that), but I could still end up with a long, scrolling list of image assets.
Thanks in advance!
Best Regards, Rick Zawadzki
assetManager: { assets: images, // an array of images noAssets: '', upload: 0, uploadText: '', addBtnText: 'Not working either', dropzone: 0, openAssetsOnDrop: 0, modalTitle: 'Select an Image', },
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Again, thank you so much @mcottret Mathieu! I will give that a shot. You’ve been incredibly helpful and I truly do appreciate it.
Thank you for entertaining and answering my multiple questions in this singular thread. I’ll open a separate question regarding pagination in the asset manager. I suspect that I’ll have to try to use
am.getContainer().insertAdjacentHTML
to insert next/previous buttons to send ajax requests and update the assets.Just as a note, the API Reference page linked to on the Asset Manager page 404s.
https://grapesjs.com/docs/modules/API-Asset-Manager
I see, sorry for the misunderstanding 😃
I didn’t know about this specific behaviour, but the assets from the loaded configuration might override the initial set value. You could try updating the assets list after loading the configuration like the following: