Open Neobii opened 8 years ago
I added this two specified schema fields to my existent schema, and here is my form tag:
quickForm collection=productsCollection doc=product id="updateProductForm" type="update"
However, delete button doesn't delete fields from array, preview doesn't works right as well, showing same image for different objects!
Also, if afFieldType is 'fileUpload', why there is mention of non-existent template 'fileUploads' in autoform.js? Is it just an unfinished and not working properly prototype?
Thanks a lot for the investigation. I will look into it and update the branch accordingly.
I added this two specified schema fields to my existent schema, and here is my form tag: quickForm collection=productsCollection doc=product id="updateProductForm" type="update"
However, delete button doesn't delete fields from array, preview doesn't works right as well, showing same image for different objects!
I have created an experimental repo, which we can use as foundation for discussion: https://github.com/jankapunkt/meteor-autoform-multiles-example
Can you confirm, that the unwanted behavior also appears there?
(P.s. you need to clone this repo into a packages
folder, since I wanted to avoid the submodules-mess)
Also, if afFieldType is 'fileUpload', why there is mention of non-existent template 'fileUploads' in autoform.js? Is it just an unfinished and not working properly prototype?
This dead reference is to be removed just now, thank you.
@anjunatic did you check into the repo?
@dr-dimitru did you have time to check into the repo? If you like it, I would make it a bit more robust and create a PR for review.
Please keep open, new PR coming in within the next days.
@jankapunkt 10.4
There is a new updated PR in this feature: https://github.com/VeliovGroup/meteor-autoform-file/pull/58
There is a new development branch called multifile on which the multiple files upload has been implemented.
!!! Note, that the feature under construction and should not be used in production until review is finished and merged to master.
In order to allow multiple uploads you have to (switch to the branch, of course and) define the scheme in the following way:
And create a quickForm like so:
Where
multipleSchema
is a helper which returns the above declared schema.It uses a queue of files as Reactive variable outside of the template instances, so it is accessible on each file input field.
If the user selects multiple files the queue will be filled and the field templates will each fetch a file to upload.
If a single file is selected, the old behavior is executed (immediately upload the file).
A good extension would be to make the queue-ing accessible to custom templates or document for custom templates how to realize multiple uploads.