Re: queue table question

  •  03-16-2010, 7:36 AM

    Re: queue table question

    I am using the script below, but that is not displaying the table that shows while uploading it displays an unformamated html table as follows
    index.html Upload Upload
    index1.html Queue Cancel
    index2.html Queue Cancel
    index.txt Queue Cancel
                                 Cancel all tasks.

    <script>

    var uploader=document.getElementById("<%=UploadAttachments1.ClientID %>");

    uploader.handlequeueui=myqueueuihandler;

     

    function myqueueuihandler(list)

    {

     

    var table;

    if(list.length<2)

    {

    document.getElementById("queuediv").style.display="none";

    }

    else

     

    {

    document.getElementById("queuediv").style.display="";

    var container=document.getElementById("queuedivtablecontainer");

    container.innerHTML="";

     

    table=document.createElement("table");

    table.style.borderCollapse="collapse";

    table.cellSpacing=0;

    table.cellPadding=4;

    table.border=1;

    table.borderColor="darkgreen";

     

    for(var i=0;i<list.length;i++)

    {

    var name=list[i].FileName

    var size=list[i].FileSize // (or -1)

     

    var stat=list[i].Status // Finish|Error|Upload|Queue

     

    var func=list[i].Cancel;

    var row=table.insertRow(-1);

    row.insertCell(-1).innerHTML=name;

    row.insertCell(-1).innerHTML=stat;

    var last=row.insertCell(-1);

    if(stat=="Queue")

    {

    var btn=document.createElement("A");

    btn.href="BLOCKED SCRIPTvoid(0)";

    btn.onclick=func;

    btn.innerHTML="Cancel";

    last.appendChild(btn);

    }

    else

     

    {

    last.innerHTML=stat;

    }

    }

    container.appendChild(table);

     

     

     

    }

    return false; //hide the default;

     

     

    }

     

    function cancelalltasks()

    {

    uploader.cancelall();

    }

     

    </script>

     

View Complete Thread