F
Filament2y ago
dyo

problem with $this->emit in filament custom page

Why my $this->emit is not functioning in filament custom page.. I'm using 2 livewire in that page. i tried to trigger something to another component with emit in method.. what should i do?
3 Replies
cheesegrits
cheesegrits2y ago
Show your code, both where you emit and listen for the events.
dyo
dyoOP2y ago
@Hugh Messenger i called both component in the same page with
<livewire:analisis.filter-kategori-donatur>
<livewire:analisis.nominal-donasi>
<livewire:analisis.filter-kategori-donatur>
<livewire:analisis.nominal-donasi>
in nominal-donasi component
protected $listeners = [
'filter'
];

public function filter($data)
{
dd('masuk');
$this->tahun = $data['tahun'];
$this->lembaga_id = $data['lembaga'];
}
protected $listeners = [
'filter'
];

public function filter($data)
{
dd('masuk');
$this->tahun = $data['tahun'];
$this->lembaga_id = $data['lembaga'];
}
the image below is the prove that the emit is working..
No description
cheesegrits
cheesegrits2y ago
Show the code that emits the event.

Did you find this page helpful?