SpreadJS 13
SpreadJS Documentation / Sample Code / Sample Code for the Widget / Setting Selection State when Editing Starts
In This Topic
    Setting Selection State when Editing Starts
    In This Topic

    You can select text when going into edit mode.

    Using Code

    This example selects the text when editing starts.

    Example Title
    Copy Code
    $(document).ready(function () 
    {
        new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
        var sheet = spread.getActiveSheet();
        sheet.setValue(0, 0, "ABC", GC.Spread.Sheets.SheetArea.viewport);
        
        // Set it to be always in input mode.
          spread.bind(GC.Spread.Sheets.Events.EnterCell, function (event, data) 
         {
            var activeSheet = data.sheet;
            activeSheet.startEdit(true);
         });
    });