Repeater field not showing correct order
# ❓questions
n
Hello, what could be the problem if I try to re-order image-blocks, then they stay in the same position? When I drag that last section to top, and save it, it "saves", then I reload it, and its still at the bottom

https://cdn.discordapp.com/attachments/811986149064441927/1091387711539134594/image.png

i
hi @Nechalon which version are you on?
n
V2.3.0.
@ifox, what could be the problem?
i
so it means it doesn't save the position correctly
can you check your database?
n
@ifox, what do I need to check in the database?
i
the blocks table and value of the position column for the blocks you are working on
n
I checked the database, and in the blocks table I dont see any record from the data that I tried to reorder
where does it save it then?
i
that's impossible. If the field is a
block_editor
, its content is saved in tbe
blocks
table.
Are you using a repeater, maybe?
n
just checked it, yes its a repeater
should I change it to
block_editor
?
i
well it depends on your use case. If the goal is to repeater a single type of something, repeaters are what you need. Block editor would let your users stack different types. So how did you implement this repeater? With a JSON column? Or with a
hasMany
relationship?
n
It has a
hasMany
relationship
i
And do you have a position column in the repeated model?
n
yes, just checked it, it has
i
if yes, and
->orderBy('position')
to your relationship
n
nice, addded it, now it works, thank you @ifox! 😄