我代替我的點擊功能的東西,像這樣得到setPostParams工作:
$('.upload_file').click(function() {
orig_top_css_wopx = parseInt(orig_top_css.replace('px','') ,10);
$('.ui-dialog').css('top', orig_top_css_wopx);
$('.ui-widget-overlay').css('display','block');
var row_id = $(this).attr('id').replace('attach_','');
row_id = parseInt(row_id,10);
//alert(row_id);
if(row_id && row_id > 0) {
swfu.setPostParams({row_id_key: row_id}); //think this should dynamically set the post param
} else {
alert('Error getting id');
}
// prevent the default action, e.g., following a link
return false;
});
和我的結合事件重置customparam:
.bind('dialogbeforeclose', function(event, ui) {
closeDialog();
swfu.setPostParams({});
return false;
});
,並獲得進步的工作,我添加了處理程序.js和fileprogress.js到我的頁面(從他們的簡單例子中)。 再變回調到它們的設置:
custom_settings : {
progressTarget : "fsUploadProgress",
cancelButtonId : "btnCancel"
},
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
queue_complete_handler : queueComplete // Queue plugin event
,並添加了HTML來獲取工作:
<div id="popup">
Please upload the files you want associated with this row below:
<span id="dialog_file_upload_btn"></span>
<input id="btnCancel" type="button" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />
<div class="fieldset flash" id="fsUploadProgress">
<span class="legend">Upload Queue</span>
</div>
<div id="divStatus">0 Files Uploaded</div>
</div>