Search...
rowData
Gets the data for the selected row.
Description
The row data is a JSON object of columnName:cellData
key:value pairs.
The object only contains the data that is displayed in the table.
If the table is connected to a dataset, the rowData
does not include the
fields from the dataset item that are not connected to table columns.
To retrieve the dataset item data that corresponds to the table row data,
use the dataset getCurrentItem()
function in the dataset onCurrentIndexChanged()
event handler.
Getting the rowData
gets the same object that is returned in the array
of rows when reading the table's rows
property.
Type:
ObjectRead Only
Was this helpful?
Get the selected table row 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 */