Is there something that happens in the saveUrl? The demo has it listed as /kendo-ui/spreadsheet/Upload.
I have a wrapper component around the kendo-upload with options.async.autoUpload set to false and a method assigned for its options.select. The method has an output of the select's e.files[0].rawfile.
function
onFileSelect(e) {
// Checking extension, etc.
// ...
this
.onSelect({
newDataFile: e.files[0].rawFile
});
}
On the spreadsheet component, once the $onChanges determines that the input changed is for the newDataFile, it calls a function to import that file. The options for the spreadsheet and the code to import the file as as follows:
this
.dataModel = {
id:
"id"
,
fields: {
id: { editable:
false
, type:
"number"
},
// Other fields...
name: { editable:
false
},
code: { editable:
true
, type:
"number"
}
}
}
this
.newDataSource =
new
kendo.data.DataSource({
schema: {
model:
this
.dataModel
}
});
this
.spreadsheetOptions = {
toolbar:
false
,
sheets: [{
dataSource:
this
.newDataSource
}]
};
function
importExcelFile(newDataFile) {
var
deferred = $q.defer();
var
spreadsheet = $scope.spreadsheet;
spreadsheet.fromFile(newDataFile)
.then(
function
() {
deferred.resolve();
});
return
deferred.promise;
}
Is there something more that I need to add to get this to function correctly with the rows? It IS working on your demo page. I should note that the first row is ignoring the styling from the original spreadsheet, too, in my code.
Thanks!