Closed S-ami closed 3 years ago
Can you write an example? I can't figure out what needs to be done
Can you write an example? I can't figure out what needs to be done
Hello, this was quite a while, so I will try my best from what I remember:
$(function () {
$('.my-uploader').each({
$(this).dmUploader({
maxFileSize: 15000000,
url: $(this).data('url'), // get data of this concrete my-uploader element
onInit: function () {
....
}
})
});
});
Basically just each loop through class that your uploaders have and then initialize the uploader inside the each loop using $(this)
Hello, so I have 3 elements with class eg. 'my-uploader' on the same page, each one of them has it's own data-url where the file should be uploaded.
I would need something like this:
Is there any way to do this or do I have to setup multiple uploaders for every one of the elements and bind them by id?
EDIT:
The solution was to loop through the $('my-uploader') class and init the uploader for each one of them and then I could easily call $(this).data('url'). I am sorry for posting this but I struggled a lot before realizing this, I can't delete this now