Replies: 2 comments 1 reply
-
additional thought, the |
Beta Was this translation helpful? Give feedback.
-
I like the new more user-friendly API including a very easy to understand Only concern is if we can provide something like
|
Beta Was this translation helpful? Give feedback.
-
The Vuu UI Table component defines three props associated with row clicking / selection
These are currently exposing data structures which should really be kept internal.
Firstly,
TableRowClickHandler
is wrong, its actually aDataSourceRow
that is returned, not aVuuDataRow
.Secondly, both
DataSourceRow
andVuuDataRow
are structures intended for internal use only. They are arrays of values which require use of a columnMap to destructure. We can provide something more user-friendly for clients.Difference between these callbacks is:
Selection
object, which is also not very user-friendly.The two select callbacks attempt to mirror a similar selection API in Salt components like LIst/Dropdown/Combobox. I'm not sure we can really preserve this pattern for Table though.
I suggest adopting the following
Where
DataSourceRowObject
is a new structureVuuDataRowDto
is a simple map of column names to values, so something like thisThe clickHandler will also return the actual click event, I think that is generally expected.
The selectHandler will just return the selected item
Not sure what to do about selectionChange handler. User could potentially select thousands of rows with a block select. The
Selection
object currently returned represents this efficiently, but its not easy to work with. We could add an API call on the datasource to getSelectedRows and maybe just make the selectionChange callback provide some info about the selection (row clicked, total rows selected etc)Beta Was this translation helpful? Give feedback.
All reactions