JC
JC
FFilament
Created by JC on 1/22/2024 in #❓┊help
file upload forbidden
No description
4 replies
FFilament
Created by JC on 1/1/2024 in #❓┊help
filament sorting using x-sortable
<div>
<button x-on:click="console.log('test')">test</button>
<div
x-data="{}"
x-sortable
x-on:end="console.log('Sorting ended!', $event)"
class="flex flex-col gap-2"
>
<div
class="py-2 bg-white px-4"
>
test1
</div>
@foreach ($users as $user)
<div
x-sortable-handle
x-sortable-item="{{ $user->id }}"
x-id="{{ $user->id }}"
class="py-2 bg-white px-4"
>
<span class="text-success-500">{{ $user->email }}</span>
</div>
@endforeach

<div
x-sortable-handle.prevent
x-sortable-item=""
class="py-2 bg-white px-4"
>
test
</div>
</div>
</div>
<div>
<button x-on:click="console.log('test')">test</button>
<div
x-data="{}"
x-sortable
x-on:end="console.log('Sorting ended!', $event)"
class="flex flex-col gap-2"
>
<div
class="py-2 bg-white px-4"
>
test1
</div>
@foreach ($users as $user)
<div
x-sortable-handle
x-sortable-item="{{ $user->id }}"
x-id="{{ $user->id }}"
class="py-2 bg-white px-4"
>
<span class="text-success-500">{{ $user->email }}</span>
</div>
@endforeach

<div
x-sortable-handle.prevent
x-sortable-item=""
class="py-2 bg-white px-4"
>
test
</div>
</div>
</div>
Given this blade file. how can I get the sorted list when clicking the button?
4 replies