2

blueimpのjqueryファイルアップロードプラグインを知っている人もいるかもしれません:https ://github.com/blueimp/jQuery-File-Upload/ 。私は次の問題を抱えています、私はすでにアップロードされたファイルでテーブルの一部を隠したいのですが、私はそれを行うことができません、私が通常のテーブルでそれをしているとき、私はそれをこのようにしています:https://stackoverflow。 com / a/215231/1353905

しかし、このテーブルコードにtbodyタグを追加しようとすると(行9、10、11を非表示にしたい-テーブルには11行が含まれています):

<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { alert(i); %}

 {% if(i==8) {   %}
<tbody style="display:none;">  // I'm ADDING THIS
 {% } %}

<tr class="template-download fade">
    {% if (file.error) { %}
        <td></td>
        <td class="name"><span>{%=file.name%}</span></td>
        <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
        <td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
    {% } else { %}
        <td class="preview">{% if (file.thumbnail_url) { %}
            <a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
        {% } %}</td>
        <td class="name">
            <a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
        </td>
        <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
        <td colspan="2"></td>
    {% } %}
    <td class="delete">
        <button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">
            <i class="icon-trash icon-white"></i>
            <span>{%=locale.fileupload.destroy%}</span>
        </button>
        <input type="checkbox" name="delete" value="1">
    </td>
</tr>

  {%    if(i==10) {  %}
</tbody>     // here are my 3 lines too
{% } %}

{% } %}
</script>
4

0 に答える 0