javascript - Dropzone.js How to use TR or TBODY as preview Template? -
there table displays files (one tr 1 file) there dropzonejs created on table can drag file , drop on table. add "preview" tr element of table can't this. how preview template looks like:
<tr class="dz-preview"> <td><span class="name" data-dz-name></span></td> <td><span class="size" data-dz-size></span></td> <td colspan="5"> <div class="progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"> <div class="progress-bar progress-bar-success" style="width:0%;" data-dz-uploadprogress> </div> </div> </td> </tr> problem dropzone.js this:
dropzone.createelement = function(string) { var div; div = document.createelement("div"); div.innerhtml = string; return div.childnodes[0]; }; tr or tbody not valid child of div created text, text doesn't have property queryselectorall, , there error.
is there solution use tr or tbody preview template?
so here's little fix in dropzone.createelement function fixes problem:
replace this:
div = document.createelement("div"); with this:
if (string.substr(0, 3) == '<tr'){ // table elements can not wrapped div div = document.createelement("tbody"); } else { div = document.createelement("div"); }
Comments
Post a Comment