Search...
onRowSelect( )
Adds an event handler that runs when a table row is selected.
Description
A table receives a TableRowEvent
when the
table is set in
the Editor to select rows when clicked.
Syntax
function onRowSelect(eventHandler: TableRowEventHandler): TableeventHandler: function TableRowEventHandler(event: TableRowEvent): void
onRowSelect Parameters
NAME
TYPE
DESCRIPTION
eventHandler
The name of the function or the function expression to run when the row is selected.
TableRowEventHandler Parameters
NAME
TYPE
DESCRIPTION
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
Get the selected table cell information
Copy Code
1$w("#myTable").onRowSelect( (event) => {2 let rowData = event.rowData; // {"fName": "John", "lName": "Doe"}3 let rowIndex = event.rowIndex; // 24} );
Get the full item information from the dataset
Copy Code
1$w("#myTable").onRowSelect( (event) => {2 let rowData = event.rowData;3} );45// ...67$w("#myDataset").onCurrentIndexChanged( (event) => {8 let itemData = $w("#myDataset").getCurrentItem();9} );1011/* rowData:12 * {13 * "fName": "John",14 * "lName": "Doe"15 * }16 *17 * itemData:18 * {19 * "_id": "e6895a76-3a89-4aa7-8f6a-023061cd8c24",20 * "_owner": "fdkr99hk-gh94-f8i4-cd8e-so4309dsk3f3",21 * "_createdDate": "2017-03-16T09:08:41.826Z",22 * "_updatedDate": "2017-03-16T09:08:58.476Z",23 * "fName": "John",24 * "lName": "Doe"25 * }26 */