SpreadJS Documentation
EditorStatus Enumeration
Specifies the editor status.
Members
MemberDescription
EditCell is in editing mode and cannot commit the input value and navigate to or select other cells.
EnterCell is in editing mode and can commit the input value and navigate to or select other cells when invoking navigation or selection actions.
ReadyCell is in Ready mode.
Example
This example uses the EditorStatus enumeration.
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">
Inheritance Hierarchy

Object
   GcSpread.Sheets.EditorStatus

See Also

Reference

GcSpread.Sheets Namespace

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.