SpreadJS Documentation
Using Rapid Input Mode

You can navigate using arrow keys when the sheet is in edit mode.

If the editor is in edit mode, the status is Enter or Edit. If the editor is not in edit mode, the status is Ready.

In Enter status, Spread commits the current input and navigates or selects other cells if the user uses navigate or select actions. In Edit status, Spread does not commit the current input and navigates or selects other cells if the user uses navigate or select actions.

Typing and double-clicking on an empty cell will cause the cell to go into the Enter status. Double-clicking on a non-empty cell causes the cell to go into the Edit status. If the cell is in Enter status and you click in the editor using the left mouse button, the status changes to Edit. Using the startEdit method is similar to double-clicking.

You can use the editorStatus type to check the edit mode.

Using Code

The following example displays the editor status.

JavaScript
Copy Code

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">

See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.