sortable() resets the sorting on 3rd click

Hello, I am facing this issue with sortable() columns on my tables. It sorts perfectly when I click on it once, then it toggles the direction on another click and then on 3rd click it just resets the sorting and then I have to click on it again to sort. Please watch the attached video for reference. Please let me know how do I fix this? Thank you so much.
Solution:
Then on 3rd click it just resets the sorting
It's the expected behaviour. If you want to change it, I think you can overwrite the sortTable() method on the ListPage...
Jump to solution
7 Replies
Lara Zeus
Lara Zeus3w ago
I dont think this is an issue, the third click is to reset the sorting for this column if the user want to sort by other column, its in the demo too https://demo.filamentphp.com/shop/products/products
mohdaftab
mohdaftabOP3w ago
@Lara Zeus I understand, but my client only wants to use this column for sorting and he wants the sorting to be either desc or asc but not reset.
Solution
Dennis Koch
Dennis Koch3w ago
Then on 3rd click it just resets the sorting
It's the expected behaviour. If you want to change it, I think you can overwrite the sortTable() method on the ListPage
mohdaftab
mohdaftabOP3w ago
@Dennis Koch thank you so much. @Dennis Koch it worked, thank you so much.
mohdaftab
mohdaftabOP3w ago
@Dennis Koch is it possible to change it for all ListPages together instead of doing it for each ListPage please?
Dennis Koch
Dennis Koch3w ago
Use a BaseClass and extend it or add a trait to all of them.
mohdaftab
mohdaftabOP3w ago
ok thank you so much 🙂

Did you find this page helpful?