我把我的点击功能替换成像这样的东西。 邮政管理处:
$( .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;
});
以及我为重新确定习俗而举行的约束性活动:
.bind( dialogbeforeclose , function(event, ui) {
closeDialog();
swfu.setPostParams({});
return false;
});
and to get progress working, i added handlers.js and fileprogress.js to my page (from their simpledemo example).
then changed the callbacks to their settings:
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
并将之添加到:
<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>