maltebaer
passing data to infolist action
hey friends 👋🏽,
i want to use filament to display repeatable data, like in some kind of accordion.
i use the infolist builder, passing my data via
state()
. now my data includes details that i want to show inside a modal. i want to trigger the modal from within the section body, not the header. my idea is as follows:
the setup works fine. i have multiple cards and i can open the modal. my problem is, that i'm not able to pass the data (here bar
) inside the modal. i have two ideas, either create a custom view bar-details.blade
or, even better, use another infolist builder inside the modal.
do you folks have any idea? or maybe even a completely different approach?4 replies
register chartjs plugin
is there an official way to register a chartjs plugin? in the docs i could not find anything related to that.
here, on discord, i found this post about how to do it. it does work fine but i'm not totally happy with publishing filament scripts and views.
3 replies
infolist: access state of another field and/or access index of repeatable entry
hey folks,
i want implement an infolist component which i'm passing data via the
state
method. no record available.
now i want to add an suffix to a field based on the state of another field. i know that within the form builder this is possible using $get
. does this exists for infolist too? could not find anything related...
my other idea was to build my own livewire component to implement the field + suffix myself. since this is used inside a repeatable entry i would need know the index of the current item/iteration. is this possible?
2 replies
make use of tailwind layers in custom theme
following the docs, i created a custom theme. now i want to apply some base styles to my panel. usually i would wrap them inside tailwinds base layer.
if i paste that snippet inside
theme.css
i get the following error
i'm not sure if that is a bug or if i'm applying the styles in the wrong place.
the other option would be to add the classes directly in the markup. is there any way to hook into/apply styles to <html>
and <body>
within the panel builder?5 replies
handle form component visibility with javascript
hey folks, i ran into the following problem.
using the form builder i render a survey that has a lot of subquestions (a question only visible if a certain answer was given). locally everything is fine. however live it feels very slow (especially with throttled network) and if you make multiple clicks per second (e.g. checkbox list), you even loose state because of the re-render.
now my idea is to initially render all the questions and do the show/hide part with javascript.
what is your suggested approach on tackling this issue? is there a
hidden()
/visible()
javascript counterpart to the already available methods? how do you track the state in the browser? is there some kind of obejct i can hook into?
fyi: additional i use a wizard to display only small chunks of the survey at once.
any kind of input/ideas highly appreciated!3 replies
getTableQuery() for pivot table that does not have a primary key
hey friends, i try to display a pivot table that does not have a primary key. i have a model for the pivot table. if i use the following query
´´´php
protected function getTableQuery(): Builder|Relation
{
return Insight::query();
}
´´´
i get the following error:
´´´
App\Http\Livewire*::getTableRecordKey(): Return value must be of type string, null returned
´´´
if i add a primary key to the pivot table, it works without problems. any ideas?
3 replies