function init_upload_fields(id) { $('#note_file_upload_field_'+id).fileUploadUI({ uploadTable: $('#files_'+id), namespace : "note_file_upload_"+id, downloadTable: $('#files'+id), dragDropSupport : true, onLoad : function (event, files, index, xhr, handler){ var json; if (typeof xhr.responseText !== "undefinied") { eval(xhr.responseText); } else { eval(xhr.contents().text()); } handler.uploadRow.remove(); }, onLoadAll: function (){ $('#data_files_'+id+' .new').each(function (){ $(this).removeClass("new"); }); }, buildUploadRow: function (files, index) { return $('' + files[index].name + '<\/td>' + '
<\/div><\/td>' + '' + 'annuler' + '<\/td><\/tr>'); } }); } $(document).ready(function ($) { //init_upload_fields(); });