Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reordering records when default order direction should be descending #14649

Open
naturalGroove opened this issue Oct 28, 2024 · 0 comments
Open
Labels

Comments

@naturalGroove
Copy link

naturalGroove commented Oct 28, 2024

Package

filament/filament

Package Version

v3.2.117

Laravel Version

v11.29.0

Livewire Version

v3.5.12

PHP Version

PHP 8.2.22

Problem description

Problem related to using Spatie's SortableTrait in the project

When we set the reorderable() parameter for the table and when we need the records on the page to appear in descending order, we cannot correctly set the order for the items in the reorder view.
I hope it sounds somewhat understandable ;)

Unfortunately, I did not find a solution to this problem in the table configuration options in the resource class.
I have a certain solution to this problem, here is a link to the repository:

https://github.com/naturalGroove/filament/tree/add-more-reorderable-configuration

Expected behavior

Ability to display records in descending order in the reorder view and correctly save the order in the database.

Steps to reproduce

Install the repository below and try to reorder Posts.

Make sure to:

migrate + seed database
login using email - pw:
[email protected] - test

Reproduction repository (issue will be closed if this is not valid)

https://github.com/naturalGroove/filament-reorderable-when-order-is-desc

Relevant log output

No response

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

1 participant