Improve API for embedding elements into tables #3662
marcuslimdw
started this conversation in
Ideas / Feature Requests
Replies: 1 comment 1 reply
-
Thanks for the proposal, @marcuslimdw! If I understand correctly, this basically moves the template definition into a new We still have hope for PR #3261, which would solve the problem more generically. But it might not be possible after all. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, in
ui.table
's documentation, to insert anything that isn't text in a table, you need to use slots and custom HTML.This provides a suboptimal developer experience because there is a need to know not just HTML, but also Vue-specific syntax.
I propose that the API of
ui.table
be modified to allow specifying objects that will abstract away this process of creating and populating slots.Summary of changes
TableFieldType
with areify
method that returns a string representing the content to be inserted into a Quasar slot.Dict
type used in thecolumns
setter (and parameter inui.table
) with an explicitly definedTypedDict
.TypedDict
, add a newfield_type
key of typeOptional[TableFieldType]
. For backwards compatibility, this key will be marked as not required (usingtyping.NotRequired
).Table._normalize_columns
to add slots as necessary (see below).TableFieldType
implementations as needed to cover common use cases.ui.table
documentation to useTableFieldType
.API comparison
Old:
New:
Type definitions and example
Example new
_normalize_columns
implementationNotes
Open design questions
Beta Was this translation helpful? Give feedback.
All reactions