|
var data = [], i = 0;
while (i < 2000) {
data.push({ Product: "XYZ" + i, Price: "2000" + i, Item: "XYZ" + i, ID: "2000" + i });
i++;
}
function updateData() {
var excelObj = $("#Spreadsheet").data("ejSpreadsheet");
excelObj.updateRange(1, { dataSource: data, startCell: "A1" });
}
$(function () {
$("#Spreadsheet").ejSpreadsheet({
scrollSettings:
{
width: "100%",
height: 470
},
allowOverflow: false
});
});
|
Thanks for the feedback,
however what i am after is not exactly to specify multiple values in a table and display starting at A1.
I am trying to add values in specific cells, so could be A1, A2, A3, B7, C9, F99, ....
|
function updateData() {
var excelObj = $("#Spreadsheet").data("ejSpreadsheet");
var i = 1;
excelObj.option("allowUndoRedo", false);
while (i < 400) {
excelObj.XLEdit.updateValue("A" + i, i);
excelObj.XLEdit.updateValue("B" + i, i + 1);
excelObj.XLEdit.updateValue("C" + i, i + 2);
excelObj.XLEdit.updateValue("D" + i, i + 3);
excelObj.XLEdit.updateValue("E" + i, i + 4);
i++;
}
excelObj.option("allowUndoRedo", true);
}
|