gizmojo
Create select option form without relationship
Trying to use the createOptionForm so that it works without a relationship.
This almost works apart from the select value/select option, is not updated even though the state is updated correctly.
2 replies
Update field state from alpine
Is there a way of setting the wire state from alpine?
E.g here the state remains the one step behind the last letter is capital.
I know I can do all this easily with
formatStateUsing
but I need it to be instant5 replies
Change column sort direction to descending by default
For a numeric column on first click to sort the column we want to show the largest first but can't find a way of doing this without writing the full sortBy query every time.
Note this is per column and not the
defaultSort
for the table.2 replies
How to hook into 'create another' action
Trying to pre-fill the form when you click 'create another' action.
It's within a relation manager's table CreateAction.
If I overwrite the footer actions when calling
makeModalSubmitAction
it's returning a StaticAction without access to the form.6 replies
Test form component's action
Is there a way of interacting with individual form components inside a form?
E.g how to call add action on a repeater?
mountFormComponentAction('data.categories', 'add')
Or testing a select's createOptionForm mountFormComponentAction('data.categories.record-183.language_id', 'editOption')
In v2 you could
Also is there a way of asserting that an action was called or is there a way to test notifications for an action. How do test the replicate action redirects to the newly created product in assertRedirect
?
This shows 'A notification was not sent'5 replies
Re-filling a form with select value
I have an issue where the select option is not being selected when the value is set for the second time.
E.g I've got a custom form inside a modal - when the modal is opened I
fill
the form based on the record you've clicked on.
Works fine on the first opening, but not if you close the modal and then reopen a different record the fill is not populating the form select value.
- It's only an issue when a select
. Works fine for text input.
- The fill is working because the $state is correct e.g ->helperText(fn ($state) => $state)
- Inspecting the DOM select options the value exists but the select value is blank.1 replies
How to read the lang file/translation when registering navigationItems in a panel?
E.g this displays the 'filament-panels::layout.actions.billing.label' instead of the translated label.
Another issue when registering a custom navigation you've unable to use the resource
getUrl
method. This used to work in v2 but getting an error that the panel has not been setup yet.
Call to a member function getId() on nullRedirects is a custom list resource page which needs registering manually Tried to manually use
route()
helper function instead of the getting the resources but that does not work either.
Route [filament.admin.resources.products.index] not defined.Confirmed the route name is correct and visible when I run
php artisan route:list
.
Adding debug code to test the routes collection is empty at the point of registering the panel configuration dd(Route::getRoutes());
8 replies
Eager loaded relationship based on table filter
I'm trying to load a relationship based on the table filter.
In v2 I could do this but in v3 throws error:
Typed property Filament\Widgets\TableWidget::$table must not be accessed before initializationWhen I switch over to using table method with filters the
when
is called but the eager relationship is never loaded causing error:
Attempted to lazy load [language] on modelTried to access the filter via livewire
$table->getLivewire()->getTableFilterState('language_id')
but this causes a recursive loop 500 error. Also tried $this->getTableFilterState('language_id')['value'] ?? null;
3 replies