AshesOfOwls / jquery.shapeshift

A dynamic grid system with drag and drop functionality.
http://ashesofowls.github.com/jquery.shapeshift/
MIT License
1.67k stars 311 forks source link

Serialization #64

Closed Biont closed 11 years ago

Biont commented 11 years ago

Is it possible to receive an array with rows and columns from shapeshift? I haven't seen a way to save layouts nor have I found any discussion regarding this on the issues list. Did I miss something?

I guess it wouldn't be too hard to get my data with external JS, but I figured it would be nice if this was built right into the plugin.

Anyway, thanks for making this!

AshesOfOwls commented 11 years ago

Since Shapeshift is dynamic to the window size it becomes difficult to save a list of columns/rows because the layout can change dynamically.

The way I went around this was to make the index position the key to saving the positions of each element. This way as long as those index positions are maintained then no matter what size the window is the elements will receive the same amount of "importance". The best part about this is that if you are saving the positions to a database you really only need to store one number instead of storing the column position and the row position.

Thanks for the support, let me know if you need any more help.