作成日: 2018/07/17 最終更新日: 2018/07/17
文書種別
使用方法
詳細
複数のセルを編集した際、直前に編集したセルの値のみをキャンセルするには、セルの編集開始時に発生するEditStartクライアント側イベントにて編集前の値やセルのインデックスを保持し、この値を再設定する処理を実装してください。
◎サンプルコード(aspx)
◎サンプルコード(aspx)
<script type="text/javascript">
var undoText;
var undoCol;
var undoRow;
window.onload = function () {
var spread = document.getElementById("FpSpread1");
spread.addEventListener("EditStart", Spread_EditStart, false);
};
function Spread_EditStart(e) {
var spread = document.getElementById("FpSpread1");
undoText = spread.Cells(e.row, e.col).GetValue();
undoCol = e.col;
undoRow = e.row;
}
function undoCell() {
var spread = document.getElementById("FpSpread1");
spread.SetValue(undoRow, undoCol, undoText, false);
}
</script>
・・・
<input id="Button1" type="button" value="button" onclick="undoCell()" />
var undoText;
var undoCol;
var undoRow;
window.onload = function () {
var spread = document.getElementById("FpSpread1");
spread.addEventListener("EditStart", Spread_EditStart, false);
};
function Spread_EditStart(e) {
var spread = document.getElementById("FpSpread1");
undoText = spread.Cells(e.row, e.col).GetValue();
undoCol = e.col;
undoRow = e.row;
}
function undoCell() {
var spread = document.getElementById("FpSpread1");
spread.SetValue(undoRow, undoCol, undoText, false);
}
</script>
・・・
<input id="Button1" type="button" value="button" onclick="undoCell()" />
旧文書番号
83052