epertinez
epertinez
FFilament
Created by Nate on 11/27/2023 in #❓┊help
Is there a way to intercept the activeTab parameter in the resource table function?
GREAT, that works. So I only need to create public function updatedActiveTab() { // It tells me this parent function does not exists. parent::updatedActiveTab(); $this->resetTable(); } And this way table gets called twice, but the second time $this->activeTab holds the correct value. Thanks!!
14 replies
FFilament
Created by Nate on 11/27/2023 in #❓┊help
Is there a way to intercept the activeTab parameter in the resource table function?
This way I can create a function in my component: public function setTabTo($tab) { $this->activeTab=$tab; $this->resetTable(); return; } That changes the variable and then resets the table. The table function is called twice, as table is called before seting the variable, but it seems to work.
14 replies
FFilament
Created by Nate on 11/27/2023 in #❓┊help
Is there a way to intercept the activeTab parameter in the resource table function?
<x-filament::tabs.item :active="$activeTab === 'frases'" wire:click="setTabTo('frases')">Frases</x-filament::tabs.item>
14 replies
FFilament
Created by Nate on 11/27/2023 in #❓┊help
Is there a way to intercept the activeTab parameter in the resource table function?
I had <x-filament::tabs.item :active="$activeTab === 'termes'" wire:click="$set('activeTab', 'termes')" >Termes</x-filament::tabs.item> But I don't know how to listen for $set, so $set was called AFTER table($table) and $this->activeTab had the old incorrect tab. If somebody can tell me what function do I have to create to listen $set('somevar','somevalue') I would appreciate. So far I tried updateSomevar($somevalue), but it does not work. Anyway, I ended up changing the calls:
14 replies
FFilament
Created by Benjámin on 4/4/2024 in #❓┊help
Conditional filter rendering by $activeTab
I am stocked in the same problem. I see livewire is sending an update in the request, BUT i don't know how to access livewire data neither so I cannot read the update to make sure all data is in sync before branching.
6 replies
FFilament
Created by epertinez on 11/28/2023 in #❓┊help
actions AND header widget in EditPage not working in v3
I know this is a nasty and unappropiated hack...
5 replies
FFilament
Created by epertinez on 11/28/2023 in #❓┊help
actions AND header widget in EditPage not working in v3
When I try to conditionally add the info through hooks in the admin panel... action buttons stop working correctly and the form becomes empty.
class AdminPanelProvider extends PanelProvider
{
public function boot(): void
{
// I don't know how to get the model in PanelProvider.
// So I forge it from the URL.
$invoice_id=substr(strstr(URL::current(),'/admin/invoices/'),16);
$invoice_id=strstr($invoice_id,'/',true);
if ($invoice_id) {
FilamentView::registerRenderHook(
'panels::page.start',
fn (): View => view('livewire.open-tickets',['tickets' => Ticket::where('active',true)->where('client_id',Invoice::find($invoice_id)->customer->id)->get()->toArray()]),
scopes: [
\App\Filament\Resources\InvoiceResource\Pages\CreateInvoice::class,
\App\Filament\Resources\InvoiceResource\Pages\EditInvoice::class,
],
);
}

}
class AdminPanelProvider extends PanelProvider
{
public function boot(): void
{
// I don't know how to get the model in PanelProvider.
// So I forge it from the URL.
$invoice_id=substr(strstr(URL::current(),'/admin/invoices/'),16);
$invoice_id=strstr($invoice_id,'/',true);
if ($invoice_id) {
FilamentView::registerRenderHook(
'panels::page.start',
fn (): View => view('livewire.open-tickets',['tickets' => Ticket::where('active',true)->where('client_id',Invoice::find($invoice_id)->customer->id)->get()->toArray()]),
scopes: [
\App\Filament\Resources\InvoiceResource\Pages\CreateInvoice::class,
\App\Filament\Resources\InvoiceResource\Pages\EditInvoice::class,
],
);
}

}
5 replies
FFilament
Created by epertinez on 11/7/2023 in #❓┊help
modalHidden() something is wrong?
But if you use ->action(function (?Model $record, array $data): void { $this->dades=$data; $this->doSomething(); } ) Then everything works as expected.
5 replies
FFilament
Created by epertinez on 11/7/2023 in #❓┊help
modalHidden() something is wrong?
ok. I reply to myself: when actions are set as an string that represents the name of the function, for whatever reason, they are always executed.
5 replies
FFilament
Created by epertinez on 10/31/2023 in #❓┊help
EditPost force redirect to ViewPost if Post has given condition
Cool! It worked!
6 replies
FFilament
Created by epertinez on 10/3/2023 in #❓┊help
Radical lazy/defer load on collapsible column.
Ok: Partially solved... I can created a PRIVATE (public does not work) attribute in my Widget class that saves the column I wanna pass the loadData function. So, instead of public function table(Table $table): Table {... return $table->...->columns([ some columns, MyOwnColumn::make('someField') ])... } I have private $myOwnColumn; public function table(Table $table): Table {...$this->myOwnColumn=MyOwnColumn::make('someField') ; return $table->...->columns([ some columns, $this->myOwnColumn])... } This way, I can have a function loadData that calls $this->myOwnColumn->loadData(), and that last function is the one that sets readyToLoad flag in myOwnColumn so I can defer loading. Yet... even if defer loading somewhat works... all columns are retreived at the same time, so it takes ages for them to load, even when I don't need them. Unusable. The problem remains.
3 replies
FFilament
Created by namrata on 9/15/2023 in #❓┊help
Split with label
Yet, if you want titles, they come BEFORE any formating of the state, don't they?
15 replies
FFilament
Created by ChesterS on 10/3/2023 in #❓┊help
Calling method in custom field type
+1 I can add that in my case, the component receiving the call is the Widget, not the Column. If I create a dummy doSomething() function in the widget definition class, the error disapears. Yet, it is useless!
7 replies
FFilament
Created by namrata on 9/15/2023 in #❓┊help
Split with label
Alternatively: Is there a way to force column labels with Split or Grid, even if custom made?
15 replies
FFilament
Created by namrata on 9/15/2023 in #❓┊help
Split with label
In my case... I need to use Split or Grid because i want a collapsible Panel or View under each row.
15 replies
FFilament
Created by namrata on 9/15/2023 in #❓┊help
Split with label
+1
15 replies
FFilament
Created by epertinez on 6/29/2023 in #❓┊help
Admin resource: Selectable table row text
Digging deeper I see that the problem is that all of those columns are <a> links to edit, so I cannot select the internal text because you cannot select internal text of a link. Yet typing ALT on the keyboard while using the mouse lets you subselect the text you want inside the link. I am going to tell my customer. Maybe it is obvious but I didn't know.
3 replies
FFilament
Created by Swan_Yee on 6/18/2023 in #❓┊help
Custom UI Filter in table builder
I found this reply that works for me: ->filters([], layout: Layout::AboveContentCollapsible)
6 replies
FFilament
Created by epertinez on 6/29/2023 in #❓┊help
getTableFiltersLayout
I found this reply that works for me: ->filters([], layout: Layout::AboveContentCollapsible)
5 replies
FFilament
Created by epertinez on 6/29/2023 in #❓┊help
getTableFiltersLayout
Ok...in an admin resource there is a table function that receives and returns Table object. Table has columns and filters method. Now I would like to tell filament that those filters should be shown AboveContent. How do I do it?
5 replies