I’m using this plugin to allow elements to be moved around http://farhadi.ir/projects/html5sortable/
but I have to remember the new order. Can you tell me if my logic below is overkill, or wrong, or where I can improve?
Initially I would store a serialized array in the database of the default order. The array would look like this:
$order = array('messages'=>1,'emails'=>2,'misc'=>3,'alerts'=>4,'details'=>5,'test'=>6);
When the page loads I would grab the serialized data, unserialize it, and loop over it. The keys could represent a method ( I would use a class ) that will build the required html.
When 1 of the elements in dragged and dropped, I’d run some ajax to update the serialized data in the db.
sound good?