How to get selected row(s) in a ui.table? #291
-
I have a table defined, with single rowSelection enabled. How do I get the selected row in the table? s_table = ui.table({
'columnDefs': [
{'headerName': 'Id', 'field': 'id'},
{'headerName': 'Start Time', 'field': 'start_time'},
{'headerName': 'End Time', 'field': 'end_time'},
],
'rowData': [
],
'domLayout': 'autoHeight',
'rowSelection': 'single',
'onSelectionChanged': 'onSensorSelectionChanged'
}).classes('w-5/6 h-auto') |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
Jan 24, 2023
Replies: 2 comments
-
I guess this has already been answered in #170. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@rodja No, #170 refers to an old NiceGUI version and is not applicable anymore. But #229 (comment) answers this question: result = await ui.run_javascript(f'getElement({table.id}).gridOptions.api.getSelectedRows()') |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
falkoschindler
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@rodja No, #170 refers to an old NiceGUI version and is not applicable anymore.
But #229 (comment) answers this question: