Calculate Totals in the footer for a table component
How can calculate the total balance of the customers and show it in the footer .Note this table component is not being used in filament admin panel but rather a laravel project with livewire
Also how can I add the view and edit actions onto this table component
85 Replies
Use Filament summarizer
let me share my code
and for the View and Edit, you just need to include them in the actions column
Okay
When I try to include the Actions I get an error
your'e probably not importing the right action
which column do you want total for?
the code is not showing complete
paste it instead of file upload
use the tripple backtick to format
Is that better
I want the view , delete ,show but I pass in my custom routes
Also I want create Action and pass in my custom route name
For the column I want to sum the balance
for the actions, i can see your'e importing the wrong action
use Filament\Tables\Actions\Action;
then chain the ->url()
to the action which will contain the custom routeClass "App\Livewire\Tables\Actions\ViewAction" not found
I get this error
I dont know if am importing everything in the right way but thats what i have
dont use
ViewAction
use normal Action
since you will be using custom route
something like this:
make sure you Implements HasActions
trait and add:
use InteractsWithActions;
Now the header actions are not appearing
But the rest are appearing
did you add any headerAction?
Yeah
I added create
check if you imported the right action
am using use Filament\Tables\Actions\Action;
probably i need to implement some trait
this is from the docs:
then in ur view:
change yours to
createAction(): Action
let me try that
Okay
I see it but its color is not visible
it shows but its gray in color
do you have a custom theme?
no
its just a tailwindcss template
probably i add css classes
if you add css it won't work, it will be stripped out. you need to create custom theme
How do I do that then
But am not using a their panel
am just using a normal liveware and tailwindcss template
did you install Filament Table package?
Yeah
I installed it
then you need to create a custom theme
also you need to tell Your AppServiceprovider the colors you will be using
because currently Your Application is unaware of the
primary
colorthe problem am not so sure
on how to do that
in your AppServiceProvider in the boot method put this:
ok am trying it
thats what i have dont
But seems no change
I have re-started the application
recompile your assets
npm run dev?
yes
There was change
*no change
Hmm
create a custom theme and style it from there
i have created
now
style the action button there
example please
in your new theme.css style the button action there, you will need to look for the class name in your inspect console
i think the name is
.fi-btn
style that class
like this:
Sorry to take you back but it seems the create custom theme didnot work as expected
i guess because you don't have a panel
just try styling the action like how you will style a button
you could wrap a div around it
then style that div and see
okay then
we could get on a call if possible
Yeah
its okay
I set up google meets?
Meet
Real-time meetings by Google. Using your browser, share your video, desktop, and presentations with teammates and customers.
not now in an hour, 45 minutes time
ok no worries
Hey @Hussain4real are you available now
no
have a meeting in 15 minutes
okay please
I mean i have a meeting to attend now will let you know once i'm through
okay then
hey @Hussain4real
Sorry mate, still in the meeting
ok no worries
Will be through 15 minutes probably
ok no problem
I'm ready if you are
am around
Meet
Real-time meetings by Google. Using your browser, share your video, desktop, and presentations with teammates and customers.
i'm waiting to be let in
i can't hear you
thank you so much
my pleasure mate
When your free please let me know
for some reason export has only cancel button
@Hussain4real are you available sir
Okay, will let you know
let me wait then
helo
Hi
Had a busy day
a good morning
we can do today
hello @Hussain4real
Hi
If you're free
am available right now
let me share google meet
Meet
Real-time meetings by Google. Using your browser, share your video, desktop, and presentations with teammates and customers.
Thank you so much it has worked
my pleasure mate!
a good morning
I just have one more issue which is to change the filter positions
on the table
does not seem to work with livewire
you probably need to include the trait
Morning
I cannot find the trait name
->filters([..], FiltersLayout::AboveContent)
That works
ok thank you so much for the help
my pleasure