Jump to content

Save move /sort order frontend


hansv
 Share

Recommended Posts

Hi

I use UIKIT3 Sortable at the frontend to make the blocks M1, M2, ... Each block is a page. 

I can move (sort) the blocks at the frontend, but how can I save the sort-order so the pages at the backend have the same sort-order as at the frontend? 

afbeelding.png.40ac69cf7b312041537be46bf8be9449.png

afbeelding.png.6374ec29b7fa8b84de8a4de00d86b9e9.png

Link to comment
Share on other sites

3 hours ago, hansv said:

Callbacks in Uikit are not well documented.   Do you have an example for 'sortable'? 

There's these events to hook into: https://getuikit.com/docs/sortable#events. Most likely you want the moved event. Here's some code stolen from the wild and a pen from the said wild:

UIkit.util.on('#sortable', 'moved', function (item) {
// do stuff
});

And a specific example on sort order:

https://stackoverflow.com/questions/47549648/uikit-how-to-get-order-with-the-sortable-component

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...