0
파일 업로드에 Plupload를 사용하고 있습니다. 구체적인 이유 때문에 FilesAdded
을 "내부"init
과 같이 입력해야합니다.추가 된 요소를 어떻게 바인딩 할 수 있습니까?
문제는 jQuery가 추가 된 요소에 jQuery.remove()
을 사용할 수 없다는 것입니다.
.on()
을 사용하여 정상적으로 해결했지만 click
등의 작업이 없으므로 첨부 된 요소를 바인딩하는 방법을 모르겠습니다. 많이 감사
모든 지침 : 이것은 remve를 트리거
// Custom example logic
var uploader = new plupload.Uploader({
runtimes : 'gears,html5,flash,silverlight,browserplus',
browse_button : 'btn-file-browse',
container : 'drag-drop-container',
drop_element : 'drag-drop-container',
max_file_size : sim_gal_data['max_file_size'],
url : sim_gal_data['upload_url'],
multi_selection : true,
init : {
FilesAdded: function(up, files) {
// Create list of files being uploaded
jQuery.each(files, function(i, file) {
jQuery('#filelist').append(
'<div id="' + file.id + '" class="file_upload">' +
'<div class="file_name">' + file.name + ' (' + plupload.formatSize(file.size) + ')' +
'</div> <label class="file_progress"><b></b></label>'
);
});
// Ready set go!
up.refresh();
up.start();
}
});
업데이트 :
uploader.bind('UploadComplete', function(up, files) {
jQuery('#filelist .file_name').remove();
// I'm able to run this - so maybe .file_name is appended?
jQuery('#filelist .file_name).append('TEST');
});
에서이를 처리해야합니다. 제거를 트리거하는 것은 무엇입니까? –
당신의 코드를 제거합니다 – Pete
@ Pete 제 질문에 제거 코드를 추가했습니다 – Steven