Improve API for embedding elements into tables #3662
Closed
marcuslimdw
started this conversation in
Ideas / Feature Requests
Replies: 2 comments 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
-
|
This feature has just been released via PR #5592 in NiceGUI 3.5.0. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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.tablebe modified to allow specifying objects that will abstract away this process of creating and populating slots.Summary of changes
TableFieldTypewith areifymethod that returns a string representing the content to be inserted into a Quasar slot.Dicttype used in thecolumnssetter (and parameter inui.table) with an explicitly definedTypedDict.TypedDict, add a newfield_typekey of typeOptional[TableFieldType]. For backwards compatibility, this key will be marked as not required (usingtyping.NotRequired).Table._normalize_columnsto add slots as necessary (see below).TableFieldTypeimplementations as needed to cover common use cases.ui.tabledocumentation to useTableFieldType.API comparison
Old:
New:
Type definitions and example
Example new
_normalize_columnsimplementationNotes
Open design questions
Beta Was this translation helpful? Give feedback.
All reactions