w454638 2011-05-13 16:07:30 5068次浏览 2条回复 0 0 0

view 如下:

<?php
$this->widget('application.vendors.swfupload.CSwfUpload', array(
    'jsHandlerUrl'=>'assets/Handlers/handlers.js', //Relative path
    'postParams'=>array(),
    'config'=>array(
        'use_query_string'=>true,
        'upload_url'=>'index.php?r=avatar/up', //Use $this->createUrl method or define yourself
        'file_size_limit'=>'2 MB',
        'file_types'=>'*.jpg;*.png;*.gif',
        'file_types_description'=>'Image Files',
        'file_upload_limit'=>0,
        'file_queue_error_handler'=>'js:fileQueueError',
        'file_dialog_complete_handler'=>'js:fileDialogComplete',
        'upload_progress_handler'=>'js:uploadProgress',
        'upload_error_handler'=>'js:uploadError',
        'upload_success_handler'=>'js:uploadSuccess',
        'upload_complete_handler'=>'js:uploadComplete',
        'custom_settings'=>array('upload_target'=>'divFileProgressContainer'),
        'button_placeholder_id'=>'swfupload',
        'button_width'=>170,
        'button_height'=>20,
        'button_text'=>'<span class="button">'.Yii::t('messageFile', 'ButtonLabel').' (Max 2 MB)</span>',
        'button_text_style'=>'.button { font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 11pt; text-align: center; }',
        'button_text_top_padding'=>0,
        'button_text_left_padding'=>0,
        'button_window_mode'=>'js:SWFUpload.WINDOW_MODE.TRANSPARENT',
        'button_cursor'=>'js:SWFUpload.CURSOR.HAND',
        ),
    )
);
?>

<?php echo CHtml::beginForm(); ?>
<div class="form">
    <div class="row">
    <div id="divFileProgressContainer"></div>
    <div class="swfupload"><span id="swfupload"></span></div>
    </div>
</div>
<?php echo CHtml::endForm(); ?>

浏览器打开的时候 报错 uncaught exception: Could not find the placeholder element: swfupload 怎么处理,求解

  • 回复于 2011-05-13 16:36 举报

    已解决,在里面加一些文字就可以了,但不知道什么原因

  • 回复于 2012-05-23 11:30 举报

    或许是编辑器初始化的时候没加载完全,添加一些文字可以加载完全

您需要登录后才可以回复。登录 | 立即注册