eliaszobody
eliaszobody
FFilament
Created by eliaszobody on 8/7/2024 in #❓┊help
Color Picker JavaScript Change Event
I'm trying to add a live preview of an element that uses a custom color defined in a filament ColorPicker. In javascript I'd like to add an event listener on the input which runs whenever the value of the input is changed. picker.addEventListener('input', () => {...}) only triggers when the value is manually changed by typing on the keyboard. But if the input value is changed by dragging around on the color picker popup, the event is not triggered. Is there some other javascript event that is dispatched whenever someone drags on the color picker popup, or is there some other way to hook into that?
2 replies
FFilament
Created by eliaszobody on 7/19/2024 in #❓┊help
Reorder form components based on screen size.
Basically, I have 2 form sections: a main section, and a config section. On screen sizes of lg or larger I'd like the config section to be to the right of the main section, but on mobile screens I want the config section to stack on top of the main section. Because the display for a form is grid, I can't add an extra attribute of flex-row-reverse. And filament (to my knowledge) doesn't allow me to add classes or inline styles to the direct child elements of this grid. Otherwise the solution would be a simple order-first and order-last. I also attempted using the ->columnStart() method, but that didn't reorder the sections, it simply created a weird offset on desktop. Is there any non-hackish way to solve this issue?
3 replies
FFilament
Created by eliaszobody on 12/23/2023 in #❓┊help
Navigation items keyby something other than label
Hey, so I'm building custom user-based navigation for my filament panel. In some cases, there will be a navigation group that should have some items with the exact same label. However when compiling the navigation, filament uses the navigation item labels as the key, and so it removes all but one of the navigation items with duplicate labels. Is there any way to force filament to key navigation items by something other than their label?
1 replies
FFilament
Created by eliaszobody on 11/8/2023 in #❓┊help
How to use the file-upload blade component in custom view.
I'm trying to implement the filament file-upload field into a custom view that I have. The documentation gives examples for inputs, selects, checkboxes, etc. But it doesn't show anything about a file upload. I tried retrieving the component in the same way that the others from the documentation were retrieved, but it didn't work. Thoughts?
5 replies
FFilament
Created by eliaszobody on 9/1/2023 in #❓┊help
Is it possible to have a checkbox select all table rows within a specific group?
I'm have this table, and I'm grouping the rows based on a division attribute. I'd like to be able to click a checkbox next to the group title that auto-selects all rows that are grouped in that specific division, so that I can perform some bulk actions on just that division. Is this possible?
5 replies
FFilament
Created by eliaszobody on 8/13/2023 in #❓┊help
How to modify options label on the attach action select.
Hey, I'm building this app in which within a Relation Manager I want to attach a gameday, which is basically just a date (e.g. 2023-08-24), but I wish to modify the option labels to make it more readable (e.g. Sunday, Aug 13, 2024. I attempted this:

AttachAction::make()->recordSelect(
fn (Select $select) => $select->getOptionLabelFromRecordUsing(
fn (Model $record) => modify($record->date)
)
)


AttachAction::make()->recordSelect(
fn (Select $select) => $select->getOptionLabelFromRecordUsing(
fn (Model $record) => modify($record->date)
)
)

But the labels didn't change at all. I even tried a dd($record->date) inside of the getOptionLabelFromRecordUsing() callback, but nothing died or dumped. So it appears that the method isn't being called at all. Certain methods (e.g. multiple()) worked as intended when called on the select, but others (e.g. getOptionLabelUsing(//) or getOptionLabelFromRecordUsing(//) didn't seem to have any effect. Am I going about this the wrong way? Is there a better way to do this? Is there an error in my code? Or did I stumble across a bug?
9 replies