nova-sortable
nova-sortable copied to clipboard
Weird index position
I have a table with less than 100 records and the position column as NULL. When I sort any record, it updates the position of all records on that page, but the index starts at 11000. Is it the expected behaviour? Because, since the other records position are NULL, they are shown first after the page refresh.
https://github.com/ofcold/nova-sortable/blob/master/resources/js/components/ResourceTable.vue#L159
What is gained by offsetting the index by 11000?
This offset has caused a bug in our application. When sorting, it only sorts for all the items on the current page. I have 25 items on a page ie. 1 .... 25 26 27 28 I sort one of the items everything is out of order ie. 26 27 28 11000 ... 11025
I am not seeing how a sort works differently for 11k vs any other number. The issue I have is that, while you have a function to define the DB column to use, there is no callback function to overwrite this offset. For me resolve this bug, I will need to improvise a bit with a function that interjects in the lifecycle of the request to manage this value. I just may fork this repo. I am just pointing out that there is no value gained from 11k vs 1, but it has the huge downside of it not being intuitive.
Share a secret why exactly 11000 is used? Why not 1?
This is a matter of personal habits, and this number has no meaning. Are there any advantages to starting from 1?
@jedlynch pointed the issue.
Hey @lilianjin, could you please publish a new version of your package (at Packagist) with the changes. Then we don't have to use the dev-master build. Also I think this Issue can be closed?