There are plenty of posts here and on the web regarding how to SAVE the state of jquery sortable list but what about restoring one?
In my case I'm organizing a page layout, not a list, so I will have a left and right column (or more).
Here is what I have done in the past (using php+smarty):
<div id="leftsort">
{section loop=$leftSort name="ls"}
{if $leftSort[ls]}{include file="index/sort/`$leftSort[ls]`.tpl"}{/if}
{/section}
</div>
<div id="rightsort">
{section loop=$rightSort name="rs"}
{if $rightSort[rs]}{include file="index/sort/`$rightSort[rs]`.tpl"}{/if}
{/section}
</div>
Each portlet has its own template file thats included. When I save the state of the sortable list I save the left and right column separate to make it easier to restore.
How would you restore the sortable list?
I would prefer a pure jquery way of doing it, example - having the portlets hidden on the page, pass a json array to the sortable list and on 'create' have it sort and display the portlets
$( ".selector" ).sortable({
create: function(event, ui) {
-- load sortable positions in a json array --
-- parse the array and move the hidden portlets into position --
-- show portlets --
}
});
For me specific code is not exactly required so any concepts or ideas are appreciated.
Thank you!
-- Thinking like: http://jsfiddle.net/8gYsy/