To learn more about using JavaScript in LeanFT, see Setting up and working with the JavaScript SDK.
For JavaScript code samples, see Code Samples - JavaScript.

EditorTO

SAPGUI. EditorTO

EditorTO

Constructor

new EditorTO()

A EditorTO object,

Methods

activateColumn(columnIndexOrName) → {Promise.<void>}

Double-clicks the specified column in the grid by column name. Double-clicking selects the entire column, displays another window, or performs another application-specific action.
Parameters:
Name Type Description
columnIndexOrName Number | string The name of the column or the column index.
Returns:
a promise that is fulfilled when the activate operation ends.
Type
Promise.<void>

activateRow(rowIndex) → {Promise.<void>}

Double-clicks the specified row in a grid.
Parameters:
Name Type Description
rowIndex Number The row index.
Returns:
a promise that is fulfilled when the activate operation ends.
Type
Promise.<void>

cells(rowopt, colopt) → {Promise.<(Array.<Array.<GridCell>>|Array.<GridCell>|GridCell)>}

Returns either a specific cell or a promise of all cells in the grid (when called without arguments), all the cells in a row (when called with row only).
Parameters:
Name Type Attributes Description
row number <optional>
The row index of the specific cell.
col number <optional>
The column index in the row, specified by the row parameter.
Returns:
either a promise for all the cells in the table (when called without arguments), all the cells in a row (when called with row only), or for the specified cell.
Type
Promise.<(Array.<Array.<GridCell>>|Array.<GridCell>|GridCell)>

clearSelection() → {Promise.<void>}

Clears the selected rows or columns in the grid.
Returns:
a promise that is fulfilled when the operation ends.
Type
Promise.<void>

doubleClick() → {Promise.<void>}

Double-clicks inside the text area at the current cursor position.
Returns:
a promise that is fulfilled when the activate operation ends.
Type
Promise.<void>

findAllRowsWithCellTextInColumn(text, column) → {Promise.<Array.<Array.<GridCell>>>}

Returns all rows with the specified text in the specified column, by column index.
Parameters:
Name Type Description
text string The The text to search for.
column Number | string The name or the index of the column to search for.
Returns:
a promise that is fulfilled with the array of array of Cells.
Type
Promise.<Array.<Array.<GridCell>>>

findRowWithCellTextInColumn(text, column, startFromRow) → {Promise.<Array.<GridCell>>}

Returns the first row in a column that contains the specified text, by column name.
Parameters:
Name Type Description
text string The The text to search for.
column Number | string The name or the index of the column to search for.
startFromRow Number The index of the row from which to start the search.
Returns:
a promise that is fulfilled with the array of Cells or null if not found.
Type
Promise.<Array.<GridCell>>

pressEnter() → {Promise.<void>}

Presses the ENTER key when the grid is in focus.
Returns:
a promise that is fulfilled when the operation ends.
Type
Promise.<void>

select(startPos, endPos) → {Promise.<void>}

Selects the specified section of text in the text area and positions the cursor at the end of the selection.
Parameters:
Name Type Description
startPos Number The 0-based position of the first character of the text to be selected.
endPos Number The 0-based position of the character that ends the selection. The text is selected from the character at the start position and up to, but not including, the character at the end position.
Returns:
a promise that is fulfilled when the activate operation ends.
Type
Promise.<void>

selectMenuItemById(menuItemId) → {Promise.<void>}

Selects the specified menu item from a context menu.
Parameters:
Name Type Description
menuItemId string The SAP ID for the menu item.
Returns:
a promise that is fulfilled when the activate operation ends.
Type
Promise.<void>

setCursorPosition(position) → {Promise.<void>}

Positions the cursor at the specified position.
Parameters:
Name Type Description
position Number The 0-based character position.
Returns:
a promise that is fulfilled when the activate operation ends.
Type
Promise.<void>

setText(text) → {Promise.<void>}

Sets the specified text in the text area.
Parameters:
Name Type Description
text string The text.
Returns:
a promise that is fulfilled when the activate operation ends.
Type
Promise.<void>

setUnprotectedTextPart(sectionNumber, text) → {Promise.<void>}

Sets the specified text in the unprotected sections of the text area.
Parameters:
Name Type Description
sectionNumber Number The 1-based index of the unprotected section in which the text is set. Unprotected sections of the text area are numbered from top to bottom.
text string The text.
Returns:
a promise that is fulfilled when the activate operation ends.
Type
Promise.<void>