|
model() {
return{
scrollSettings: {
height: "530",
scrollMode:"normal"
},
sheets: [{
rangeSettings: [{ dataSource: window.dataColl, startCell: "A1" }]
}],
loadComplete: function() {
var xlFormat = this.XLFormat;
if (!this.isImport) {
this.setWidthToColumns([140, 128, 105, 100, 100, 110, 120]);
xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1");
xlFormat.format({ "type": "currency" }, "E2:H11");
$("#Spreadsheet_Ribbon").data("ejRibbon").collapse();
this.XLRibbon.updateRibbonIcons();
}
},
cellSave: function(args){
console.log(args);
}
}
} |
|
<div class="content-container-fluid">
<div class="row">
<div class="cols-sample-area">
{{ej-spreadsheet id="Spreadsheet" e-scrollSettings=model.scrollSettings e-allowFormulaBar=model.allowFormulaBar e-columnWidth = 100 e-rowCount=20 e-columnCount = 10 e-sheets=model.sheets e-loadComplete=model.loadComplete e-cellSave=model.cellSave }}
</div>
</div>
</div>
{{outlet}}
|
Thanks Shanmugaraja.
regarding limiting number of rows and columns, I am expecting something more like how the ejGrid works. When I set the row count and column count, it did not change the behavior in any way. I may not have set the scroll mode correctly and will need to try that.
regarding cellSave, are you suggesting that the DataManager only supports a one way transfer of data from my data source (Ember Model) into the spreadsheet natively and that I must use spreadsheet events to push data changes back into my data source? I tried creating a data manager with a customer adaptor, but the update method was never invoked.
I would prefer to put the update logic in a data manager or customer adaptor. If the logic only works in the cellSave event, then I will put it there. I just need to know so that I can have the right mental model for how updates work.
Mark