activeSheet.isPaintSuspended(true);
setstatus(activeSheet);
GcSpread.Sheets.SpreadActions.startEditing = function () {
if (!this.isEditing()) {
this.startEdit();
}
};
activeSheet.isPaintSuspended(false);
activeSheet.addKeyMap(113, false, false, false, false, GcSpread.Sheets.SpreadActions.startEditing);
activeSheet.bind(GcSpread.Sheets.Events.EditStarting, function () {
var ev = window.event || arguments.callee.caller.arguments[0];
var code = ev.keyCode || ev.which;
if (code === 113) {
activeSheet._editorStatus = GcSpread.Sheets.EditorStatus.Edit;
}
setstatus(activeSheet);
var textBox = activeSheet._editor;
if (textBox) {
$(textBox).bind("mouseup", function () {
setstatus(activeSheet);
});
$(textBox).bind("keydown", function () {
var ev = window.event || arguments.callee.caller.arguments[0];
var code = ev.keyCode || ev.which;
if (code === 113 && activeSheet.editorStatus() === GcSpread.Sheets.EditorStatus.Enter) {
activeSheet._editorStatus = GcSpread.Sheets.EditorStatus.Edit;
} else if (code === 113 && activeSheet.editorStatus() === GcSpread.Sheets.EditorStatus.Edit) {
activeSheet._editorStatus = GcSpread.Sheets.EditorStatus.Enter;
}
setstatus(activeSheet);
});
}
});
activeSheet.bind(GcSpread.Sheets.Events.EnterCell, function () {
setstatus(activeSheet);
});
});
function setstatus(activeSheet) {
var statusnow = activeSheet.editorStatus();
if (statusnow === GcSpread.Sheets.EditorStatus.Ready) {
$("#status").text("Ready");
} else if (statusnow === GcSpread.Sheets.EditorStatus.Enter) {
$("#status").text("Enter");
} else if (statusnow === GcSpread.Sheets.EditorStatus.Edit) {
$("#status").text("Edit");
}
}
// This creates the status label
<label id="status" style="margin: 10px">