getSelectedRows

Hi guys
I am just wondering how do you use getSelectedRows()? How to fix this issue ?


many thanks
Johnny

See if this helps you,

No because that applies to Vision

Sorry, didn’t look close enough to his post.

The problem is in line 4, there is no attribute implemented getSelectedRows() by default.

You should errase line 4 and iterate over self.props.selection.data, like this

for sd in self.props.selection.data:
     id = sd["ID"]
2 Likes

getSelectedRows()
Is a function only on the vision table component.

For the perspective flavor, the selected data is a property. Try

rows = self.getSibling(‘Table’).props.selection.data

Also, keep in mind that this data will be formatted as a Python array of dict, not an ignition dataset, so you will have to access your ID value like id = row[‘ID’]

2 Likes