plupload browse_button不显示浏览对话框 [英] plupload browse_button not showing browse dialog

查看:223
本文介绍了plupload browse_button不显示浏览对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用plupload队列将图像上传到我们的服务器。我将browse_button的值设置为超链接的id,因此它显示一个浏览对话框。但是,当我单击该超链接时,没有任何内容显示,浏览器视图只会进入页面中间。下面是一些代码。

I'm using plupload queue to upload images to our server. I am setting the value of browse_button to the id of a hyperlink, so it shows a browse dialog box. But when I click that hyperlink, nothing shows up, and the browser view just goes to the middle of the page. Below is some of the code.

(顺便说一句,我正在使用jQuery UI的对话框弹出图片上传div :)。

(Btw, I'm using jQuery UI's dialog box to pop up the image upload div:)

<div id="dialog-form" title="Upload Images">        
    <div id="container" style="height: 200px;"></div>
    <br style="clear: both" />
    <a id="pickfiles" href="#">[Select files]</a>
</div>

<script type="text/javascript">
$(document).ready(function () {
$("#container").pluploadQueue({
       // General settings
       runtimes: 'gears,flash,silverlight,browserplus,html5',
       browse_button: 'pickfiles',
       url: '/someurl/image-upload',
       max_file_size: '10mb',
       chunk_size: '1mb',
       unique_names: 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,tiff,jpeg" }
                ],

                // Flash settings
                flash_swf_url: '/someurl/js/plupload.flash.swf',

            // Silverlight settings
            silverlight_xap_url: '/someurl/js/plupload.silverlight.xap'
        });

        //setup upload image dialog box
        $("#dialog-form").dialog({
            autoOpen: false,
            height: 400,
            width: 400,
            modal: true
        });
});

任何人都可以告诉我为什么这样正在发生而不是打开一个浏览框?谢谢。

Can anyone tell me why this is happening instead of it opening a "browse box"? Thanks.

推荐答案

plupload队列小部件不接受你的 browse_button param,因为它是在实例化队列小部件之后已经处理了选项集后,在内部设置自己的

The plupload queue widget won't accept your browse_button param as it's internally setting its own after it already processed the options set when instantiating the queue widget.

鉴于运行时也使用init事件然后附加他们的内容需要工作,一旦在队列小部件上覆盖了 browse_button ,它就会直接转到使用该参数集的所选运行时,如果你想捕获init事件,如果只是之后所有这一切已经发生,这已经太晚了。

Given that the runtimes also use the init event to then attach what they need to work, once the browse_button is overriden on the queue widget it goes directly onto the selected runtime with that param set, and if you wanted to capture the init event if would only be after all this already happened, which is too late.

话虽这么说,除了修改队列小部件之外别无他法你自己。

That being said, there's nothing you can do other than modifying the queue widget by yourself.

这篇关于plupload browse_button不显示浏览对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆