© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago•
4 replies
o.m

Why is livewire dispatch not triggering the function?

I have a custom field in Filament called
custom-repeater.blade.php
custom-repeater.blade.php


contains this script, after rearranging the order

<script>
        document.addEventListener('DOMContentLoaded', () => {
            initializeSortable();
        });

        function initializeSortable() {
            const sortableElement = document.getElementById('sortable');
            if (sortableElement) {
                const sortable = new Sortable(sortableElement, {
                    handle: '.sortable-handle',
                    animation: 150,
                    onEnd: (event) => {
                        const newOrder = Array.from(event.to.children).map(item => item.dataset.index);
                        Livewire.dispatch('reorder', newOrder);
                    },
                });
            }
        }
    </script>
<script>
        document.addEventListener('DOMContentLoaded', () => {
            initializeSortable();
        });

        function initializeSortable() {
            const sortableElement = document.getElementById('sortable');
            if (sortableElement) {
                const sortable = new Sortable(sortableElement, {
                    handle: '.sortable-handle',
                    animation: 150,
                    onEnd: (event) => {
                        const newOrder = Array.from(event.to.children).map(item => item.dataset.index);
                        Livewire.dispatch('reorder', newOrder);
                    },
                });
            }
        }
    </script>

The main problem is that It doesn't trigger this function inside the livewire class at
EditGroupSetting.php
EditGroupSetting.php



It should be able to call that function once I drag the button
    public function reorder(): void
    {
        dd("Hellow orld");
        $this->options = array_values($this->options);
    }
    public function reorder(): void
    {
        dd("Hellow orld");
        $this->options = array_values($this->options);
    }
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Triggering Filament Action with a Livewire.dispatch event
FilamentFFilament / ❓┊help
3y ago
$livewire->dispatch('refresh') not updating data
FilamentFFilament / ❓┊help
10mo ago
Livewire.interceptMessage is not a function
FilamentFFilament / ❓┊help
2w ago
404 after dispatch livewire event
FilamentFFilament / ❓┊help
13mo ago