0

I want to sort list Using drag and drop sorting on Filamentphp custom page

I used this example

<div
    x-data="{}"
    x-sortable
    x-on:end="console.log('Sorting ended!', $event.detail)"
    class="flex flex-col gap-2"
>
    @foreach ($tasks as $task)
        <div
            x-sortable-handle
            x-sortable-item="{{ $task->id }}"
            class="py-2 bg-white px-4"
        >
            {{ $task->title }}
        </div>
    @endforeach
</div>```
to sort list, sorting work fine but I have an issue $event.detail is always null, How I can get the sorted list


I try to use `x-on:sortupdate` event but it not works
```

1 Answer 1

0

You don't need $event.detail, just use $event and you will get all details you want.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.