You would have to do the following to save the order data into the WordPress DB,
- Do a WordPress AJAX sending the data that you want to be stored in it. You can do it at every re-arrange event of the elements.
- Handle the AJAX call in PHP and either do an update_option() or an update_user_meta() to save the data.