Jquery UI sortable programmaticaly update DOM positions

Jquery UI sortable programmaticaly update DOM positions

I am using jquery ui sortable widgets. I am storing the ids of DOM by this -

sortedIDs = $( "#sortable" ).sortable( "toArray" );

I am saving this sortedIDs in mysql database.

Now I want to use it when this page loads again. So I want the DOM positions sorted like the last time I did which order is - sortedIDs.

Can I use or push that sortedIDs somehow?

Thanks.