excelImport
Fired when the user imports a file after selecting it from the window prompt. The event is fired before the file importing has finished.
Event Data
e.sender kendo.ui.Spreadsheet
The widget instance which fired the event.
e.file Blob|File
The file that is being imported.
e.preventDefault Function
If invoked, the Spreadsheet will not import the file.
e.promise Promise
A promise that will be resolved when the import operation completes.
The progress handler of the promise will be called periodically with the following arguments:
-
sheet
- The current sheet. An instance of kendo.spreadsheet.Sheet. -
progress
- A number if the range is from0
to1
which indicates the progress of the current import operation.
Example - monitoring the progress of an import operation
<div id="spreadsheet"></div>
<script>
$("#spreadsheet").kendoSpreadsheet({
excelImport: function(e) {
e.promise
.progress(function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(kendo.format("{0:P} complete", e.progress));
})
.done(function() {
alert("Export completed!");
});
}
});
// Click the Open command and select a file to import
</script>