-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload widget does not work with javascript #151
Comments
Any output from developers console ? |
Did you try to do the same dynamic initialization with Like that:
|
yes, but the same error comes out |
Are you using the latest version? There was a similar bug fixed in one of the latest versions. |
I 'm using the latest version, So far I continue with that error. |
Can you please show/paste the generated HTML in the generated view? Like copy paste the whole generated I'm guessing that there may be a id/naming issue while handling these "file inputs". Also, are they running in the same |
@XzAeRo they running in the same |
Sorry for pinging back so late on this issue. So I've been testing a lot DynamicForm, and this is not a problem with our widget. This is a problem with the clone function that the DynamicForm uses to "copy" the elements. And your suggestion to use this code is in the right direction: $(".dynamicform_wrapper").on("afterInsert", function(e, item) {
$(item).find("input[name*='[image]']").yiiUploadKit({
"url": ["/file/storage/upload"],
"maxFileSize":5000000,
});
}); I managed to make things work by doing something like this: $(".dynamicform_wrapper").on("afterInsert", function(e, item) {
$.each($(".my-input-field-css-class"), function (index, element) {
$(this).yiiUploadKit({
"url": ["/file/storage/upload"],
"maxFileSize":5000000,
});
});
}); Now, this is out of the scope of our project, and more of an integration use case. But this should be useful for the future. |
Updating
I'm using the widget (trntv \ filekit \ widget \ Upload) in a dynamic form (wbraganca\dynamicform\DynamicFormWidget), I notice that the widget works only on the first element, when adding others it does not load, try using javascript but the following error appears. Please can you advise me how to solve this problem. Thank you.
JavaScript
_form
HTML generated:
HTML generated:
Form complete generated in HTML --> HERE
I'm sorry for not responding before, I was somewhat busy with other things.
The text was updated successfully, but these errors were encountered: