Feature Enhancement: Display Selected ModalTableSelect Records as a Table #17754
zishang520
started this conversation in
Ideas
Replies: 0 comments
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.
-
Component
Filament\Forms\Components\ModalTableSelect
Problem
The current
ModalTableSelect
component allows for selecting records from a table in a modal window. However, after the selection is made and the modal is closed, the component on the form only displays the records as a simple list of text, which is a one-dimensional and not very user-friendly representation. This is especially problematic when multiple records are selected, or when the user needs to quickly see details about the selected records without re-opening the modal.Proposed Solution
I propose adding a new method to the
ModalTableSelect
component, for example,table()
, which would allow developers to define how the selected records are displayed on the form. Instead of the current text-based display, this method would render the selected records as a Filament table, complete with columns.This would provide a much more intuitive and user-friendly experience, as it:
Presents data clearly: Users can see the selected records in a structured, multi-column format.
Maintains consistency: The display on the form would be consistent with the table inside the modal.
Improves data overview: Users can quickly scan key information (e.g., name, production date, SN) without opening the modal.
Example Usage (Pseudo-code)
If the
table()
method is not passed any arguments, it should default to using the table configuration defined intableConfiguration()
(e.g.,tableConfiguration(DevicesTable::class)
). This would allow for a streamlined display without requiring the developer to redefine the table columns.Mockup of the proposed feature
This is what the component would look like after the enhancement, showing the selected records as a table directly on the form.
This enhancement would greatly increase the utility of the
ModalTableSelect
component, especially for applications that require a clearer, more organized way to display selected relationships.And how to load data independently of relationships, using it solely as a model table selector (requiring you to define the primary key yourself).
Beta Was this translation helpful? Give feedback.
All reactions