У меня есть файл ввода в сетке Dojo, я вызвал функцию onChange, и у меня есть данные в объекте файла, но когда я отправляю форму, содержимое файла пусто.Я также создал фиктивный входной файл для установки содержимого файла, но он работает в Chrome, но он не работает в IE. Пожалуйста, смотрите код ниже.
document.getElementById ('dummyId'). Files = event.target.files;
Примечание. dummyId - это идентификатор временного входного файла.Он работает в Chrome, но не работает в IE.Не могли бы вы помочь мне, почему он не работает в IE.
Пожалуйста, смотрите код ниже.
<table data-dojo-type="dojox.grid.EnhancedGrid"
data-dojo-id="documentsGrid" selectionMode="none"
data-dojo-props='store: documentsGrid_data,
keepSelection: true,
canEdit: documentsGrid_edition,
canSort: function(col) {
if(col === this.getColumnTogglingItems().length) return false;
return true;
},
autoHeight: true,
plugins: {
indirectSelection: {
noresize: true
},
pagination: {
defaultPageSize : 10,
sizeSwitch: false
}
}'>
<thead>
<tr>
<th field="documentId" formatter="formatOptions" noresize="true" width="14px" headerClasses="alignTextLeft" cellClasses="alignTextCenter">
<s:message code="common.input.label.options" />
</th>
</tr>
</thead>
</table>
<span style="display:none;" id="documentUpload">
<input type="file" id="file" onchange="onFileUpload(event, 0);" accept="image/*,application/pdf" style="width : 80px;"/>
</span>
<input style="display: none;" id="dummyId" name="dummyDocument" type="file" class="width178"/>
function formatOptions(rowIdx){
var input = dojo.byId('documentUpload').innerHTML
return input;
}
function onFileUpload(event,idx){
document.getElementById('dummyId').files = event.target.files;
}