Spread.Sheets Documentation > Sample Code > Sample Code for the Widget > Setting Selection State when Editing Starts |
You can select text when going into edit mode.
This example selects the text when editing starts.
JavaScript |
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); }); }); |