SpreadJS 13
GC.Spread.Sheets Namespace / EditorStatus Enumeration
In This Topic
    EditorStatus Enumeration
    In This Topic
    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.
    <script type="text/javascript">
        window.onload = function () {
            var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
            var activeSheet = spread.getActiveSheet();
    
    spread.commandManager().register("startEditing", {
                canUndo: false,
                execute: function (context, options) {
                    var sheet = context.getSheetFromName(options.sheetName);
                    if (sheet && !sheet.isEditing()) {
                        sheet.startEdit();
                    }
                }
            }, 113, false, false, false, false);
    
            setstatus(activeSheet);
            activeSheet.bind(GC.Spread.Sheets.Events.EditorStatusChanged,function(e,args){
                setstatus(activeSheet, args.status);
            });
        }
    
        function setstatus(activeSheet,status) {
            var statusnow = status || activeSheet.editorStatus();
            if (statusnow === GC.Spread.Sheets.EditorStatus.ready) {
                $("#status").text("Ready");
            } else if (statusnow === GC.Spread.Sheets.EditorStatus.enter) {
                $("#status").text("Enter");
            } else if (statusnow === GC.Spread.Sheets.EditorStatus.edit) {
                $("#status").text("Edit");
            }
        }
    </script>
    
    // This creates the status label
    <label id="status" style="margin: 10px">
    Inheritance Hierarchy

    Object
       GC.Spread.Sheets.EditorStatus

    See Also