BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
$(function () {
$("#Spreadsheet").ejSpreadsheet({
columnWidth: 90,
loadComplete: "onLoadComplete"
});
$("#updateCellValElem").bind("click", function () {
var ssObj = $("#Spreadsheet").data("ejSpreadsheet"), cellAddr = $("#cellAddrElem").val(), cellValue = $("#cellValueElem").val();
ssObj.XLEdit.updateCellValue({ rowIndex: ssObj.getRangeIndices(cellAddr)[0], colIndex: ssObj.getRangeIndices(cellAddr)[1] }, cellValue);
});
});
function onLoadComplete(args) {
var settings = { dataSource: dataSource, showHeader: true, startCell: "A1" };
// To update range of cells with the specified settings
this.updateRange(1, settings); // 1 => Sheet Index
settings = { dataSource: newDataSource, showHeader: false, startCell: "A13" };
// To update range of cells with the specified settings
this.updateRange(1, settings); // 1 => Sheet Index
}
<table>
<tr>
<td>Enter the cell address & value to update:</td>
<td>
<input type="text" id="cellAddrElem" value="A2" /></td>
<td>
<input type="text" id="cellValueElem" value="TEST" /></td>
<td>
<button id="updateCellValElem">Update it</button>
</td>
</tr>
</table>
//...
<div id="Spreadsheet"></div>
|