// Livewire
public function addToRepeater()
{
Log::debug('card-added'); // this point is reached
$this->dispatch('card-added');
}
// View
<x-filament::page x-on:card-added.window="handleCardAdded()">
// ... page code
</x-filament::page>
<script>
document.addEventListener('livewire:initialized', () => {
console.log('here');
@this.on('card-added', (event) => {
console.log('added');
});
});
function handleCardAdded()
{
console.log('handleCardAdded');
}
</script>
// Livewire
public function addToRepeater()
{
Log::debug('card-added'); // this point is reached
$this->dispatch('card-added');
}
// View
<x-filament::page x-on:card-added.window="handleCardAdded()">
// ... page code
</x-filament::page>
<script>
document.addEventListener('livewire:initialized', () => {
console.log('here');
@this.on('card-added', (event) => {
console.log('added');
});
});
function handleCardAdded()
{
console.log('handleCardAdded');
}
</script>