© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
4 replies
delboy1978uk

Modal with custom view sortable javascript?

I have a page with a custom modal configured like so
            $action = Action::make('order_item_process_steps')
            ->label('Process steps')
            ->modalContent(fn(OrderItem $item): View => view(
                'tables.order-item-process-steps',
                [
                    'orderItemProcessSteps' => $item->orderItemProcessSteps,
                    'isReleased' => $releaseService->isReleased($item->order),
                    'rootStep' => $item->root_step_no,
                ],
            ))
            ->modalSubmitAction(false);
            $action = Action::make('order_item_process_steps')
            ->label('Process steps')
            ->modalContent(fn(OrderItem $item): View => view(
                'tables.order-item-process-steps',
                [
                    'orderItemProcessSteps' => $item->orderItemProcessSteps,
                    'isReleased' => $releaseService->isReleased($item->order),
                    'rootStep' => $item->root_step_no,
                ],
            ))
            ->modalSubmitAction(false);

we used to have our pages as plain livewire, and we were using
sortablejs
sortablejs
, however the javascript in the view does not seem to work, I can't even seem to get a console log! Can anyone help?
Solution
This is because livewire loads after the dom, you should load in the JS function into the app.js for example and then run the function. I.e. see
https://livewire.laravel.com/docs/javascript
Laravel
JavaScript | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
JavaScript | Laravel
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Cant display modal with custom view
FilamentFFilament / ❓┊help
2y ago
Custom Modal View for ViewAction
FilamentFFilament / ❓┊help
3y ago
Modal View with Relationship
FilamentFFilament / ❓┊help
2y ago
custom view with form modal to create record
FilamentFFilament / ❓┊help
3y ago