FineUploader is not added to DOM #472
Comments
Have you tried to actually put some text in you dom élément (div)? See the |
You need to specify a button element (via the button option) when using
|
Docs says different:
|
...and you are not using the callbacks properly. If you are going to use
|
I said the button option, not the element option. You must specify a
|
I've updated example but still doesn't work. How can I specify button property properly? |
It works now. But why do I have to specify button? |
One more question. Why do I get the following error onValidate event when file extension is not on upload list?
|
Regarding your error message, this is actually referring to your "error" event handler. You are referencing an You have to specify a button so Fine Uploader knows where to hide the input element. FU adds a "hidden" I am an avid jQuery user, and have developed the plug-in/wrapper such that it embraces all standards and conventions that jQuery users have come to appreciate. I'm not sure what your experience level is with jQuery and jQuery plug-ins. If you are not particularly experienced in this area, you probably won't benefit much from using the plug-in. Instead, working directly with the "naked" Fine Uploader library may make most sense. The jQuery plug-in intentionally does not offer any features above and beyond those offered by the "naked" library. It simply provides a way of using Fine Uploader that is likely very familiar and comfortable for those who are accustomed to using jQuery plug-ins in their apps. Also, you should remove the trailing comma after your |
If I understand you right that I need to wrap uploadButton inside parent container? Please take a look a the updated example above if I've done it right? |
You just need an element specifically to function as the select files
|
So different element for plugin instance and for button. Ok, I understand but don't see the need for this... |
Also, you can remove the |
Did you read my explanation on why this is needed? Again, the element tied I would expect those familiar with jquery plugin conventions to not be
|
I am aware of the confusion. But the button could be the same as instance by default. If you need to specify different element for button is up to you. It's just my thought. Thanks! |
Borut, if you build a real application, your advice regarding inference of the button element when in FUB mode starts to break down. As it stands, the code you have presented above is not usable. It provides no feedback to users at all. Let's say we continue to build upon your example above, and provide some very rudimentary feedback for users after they select a file. Let's also go with your suggestion that the plug-in instance is also the button element. ...
.on('submit', function(event, if, filename) {
var $selectedFile = $('<div></div>');
$selectedFile.text(filename);
$(this).append($selectedFile);
} Any jQuery plug-in user would want to simply append the div element containing the file info to the plug-in container. The convention is to append it to "this". In your case, "this" is, by default, a button. We certainly don't want to append this element to the button. So, now instead of using the accepted convention of appending content to "this", we have to append it to some other element not at all associated with the plug-in instance. What I'm saying is, it is generally not a good idea to invent your own convention when one already exists. |
I absolutely agree with you and that's why I will use this preferred solution. Thanks for explanation and understanding... |
Hello Ray!
I've just upgraded uploader to 3.0 version with some issue. After plugin init no input element gets attached to DOM. Is this because of jQuery wrapper ?
Anyway, upload doesn't work. Here is the code:
Upload container with button:
FineUploader initializer code:
I get no error and nothing happens on docUploadButton click. Am I doing smth. wrong ?
The text was updated successfully, but these errors were encountered: