ArnoNym
Component as row in TableBuilder
Thanks for the very quick reply.
I am using this component also in other places in the application and i want to reuse/share the view because the view is the same no matter where the row is shown.
Sometimes in filament table, sometimes in other blade views via:
So is there a way to render a component inside the filament table as row or do i need to set the default values for the properties in the blade view and again in the component?
Thanks alot
7 replies
Usage of Filament input Component/select with searchable and multiple inside blade
Thanks for your very fast reply.
Can you give me an example or a link on how to do that?
All i found is adding
purge: [
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
// ...
],
to tailwind.config.js
is that the correct way?
10 replies
How can I sort by a custom Column
I am not sure if a virtual column can be used in our case.
We calculate the distance from the user (geolocation.getCurrentPosition) to a model (known gps lat and long).
the location of the user is determined in a js function which calls a php function on the component class.
I am able to calculate the distance in the "state" function of the textColumn like this:
Tables\Columns\TextColumn::make('distance')
->label('distance')
->state(function (Model $record): string {
$distance = CustomStringHelper::calculateDistance($this->gps_lat, $this->gps_long, $record->gps_lat, $record->gps_long);
return (int)$distance . 'km';
})
->sortable(),
But neither the sortable nor the ->defaultSort is working ...
Anyone has an idea how to do that sortable?
10 replies
Plugin v2 -> v3 upgrade - custom view page not showing header actions
It seems like it is the same problem as i have. The Actions are still there but it seems like they are disabled or displayed with low opacity.
I am sry that i can not tell you how to fix it. For myself i use a workaround:
->headerActions([
// Workaround until it is possible to attach a normal "Actions\Action" as headerActions with correct visualization
Tables\Actions\AttachAction::make('test')
->label()
->icon('heroicon-o-arrow-path')
->action(''),
], position: HeaderActionsPosition::Bottom)
In my Post (link mentioned above) @awcodes guessed that we are missing the import of a class ...
7 replies
Plugin v2 -> v3 upgrade - custom view page not showing header actions
Hey
Could you please provide us a screenshot of the visualisation?
You write that the "actions are not displaying as expected" is it the same visual as i describe in https://discord.com/channels/883083792112300104/1186674811938820106 ?
7 replies
How can I sort by a custom Column
Ciao
I know i am late but i wanted to recycle this question instead of making a new one.
Is it still not possible to define a ->defaultSort on a calculated column?
Or is it possible to get the rows of the table in php to implement a custom sorting/ defaultSort?
I have a column in my table like this:
->columns([
Tables\Columns\TextColumn::make('distance')
->label('distance')
->state(function (Model $record): string {
$distance = CustomStringHelper::calculateDistance($this->gps_lat, $this->gps_long, $record->gps_lat, $record->gps_long);
return (int)$distance . 'km';
})
->sortable(),
])
and at the table ->defaultSort('distance')
Is there a way to achieve this?
10 replies
HeaderActions in Component (not Resource)
😌 so it seems the problem is just in my setup and i have to deppDive into the classes to find the missing installation.
Just to make sure: Your example is inside a (class extends) component and not inside a (class extends) resource isnt it?
12 replies
HeaderActions in Component (not Resource)
Thanks for the reply. @awcodes
I am quite sure we installed all the classes but i will doubleCheck.
Are you able to add an action to headeractions in a component without this strange visualisation?
12 replies
HeaderActions in Component (not Resource)
Additional Information:
I want to use a table as described here: https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component
But with a ->headerAction([])
12 replies