file-upload-with-preview
file-upload-with-preview copied to clipboard
how to capture the event with jquery?
how to capture the event with jquery?
I haven't used jQuery in a while, but I think one way that you could do it would be:
$(window).on('fileUploadWithPreview:imagesAdded', function (e) {
console.log(e.detail)
});
The above would capture the Event.IMAGE_ADDED
event. You can look at src/constants/events.ts
to see the other available event strings.
If you search around a bit you should find some further methods around this - one improvement to the above code would be to attach the .on()
handler to a parent div
rather than the actual window.
Links: