Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Dynamically set options.rows

$
0
0

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.

functiononFileSelect(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 = newkendo.data.DataSource({
    schema: {
        model: this.dataModel
    }
});
 
this.spreadsheetOptions = {
    toolbar: false,
    sheets: [{
        dataSource: this.newDataSource
    }]
};
 
functionimportExcelFile(newDataFile) {
    vardeferred = $q.defer();
    varspreadsheet = $scope.spreadsheet;
    spreadsheet.fromFile(newDataFile)
        .then(function() {
            deferred.resolve();
        });
    returndeferred.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!


Viewing all articles
Browse latest Browse all 78072

Trending Articles