2

我正在尝试清空 plupload 队列,但它不起作用。我检查了一些 SO 问题并遵循了它们,但没有一个对我有用。难道我做错了什么?

// Convert divs to queue widgets when the DOM is ready
$(function () {
    $("#uploader").pluploadQueue({
        // General settings
        runtimes: 'flash,html5,silverlight,browserplus,gears,html4',
        url: '<%= Page.ResolveUrl("~")%>Memories/HandlerAlbumUploader.aspx',
        max_file_size: '10mb',
        chunk_size: '1mb',
        unique_names: true,
        multiple_queues: true,
        // Resize images on clientside if we can
        //resize: { width: 320, height: 240, quality: 90 },

        // Specify what files to browse for
        filters: [
        { title: "Image files", extensions: "jpg,gif,png" }
    ],

        // Flash settings
        flash_swf_url: '<%= Page.ResolveUrl("~")%>Memories/js/plupload.flash.swf',

        // Silverlight settings
        silverlight_xap_url: '<%= Page.ResolveUrl("~")%>Memories/js/plupload.silverlight.xap',

        init: { StateChanged: function (up) {
            // Called when the state of the queue is changed
            if (up.state == plupload.STOPPED) {
                $('#<%=btnSubmit.ClientID%>').removeAttr('disabled');


            }
        }
        }
    });

    var uploader = $('#uploader').plupload('getUploader');
    uploader.splice();
    uploader.refresh();
});
4

1 回答 1

3

您可能想要做的是制作一个按钮或链接,单击时会调用uploader.splice().

您还需要为 QueueChanged 事件 (Use uploader.bind()) 创建一个回调,该回调将由您对splice(). 使此回调函数清除/重置代表您的队列的 UI 元素。

阅读文档,所有信息都在那里:http ://www.plupload.com/plupload/docs/api/index.html#class_plupload.Uploader.html

于 2012-12-15T03:07:54.640 回答