javascript - Best way to save drag and drop layout -


i've seen question few times have individual objects , cookies. building application toolbox drag , drop functionality (very you'd see in visual studio - i.e. dragging objects onto form, giving them name, etc...) therefore droppable area have many objects including nested droppables.

any opinions on best way save sql server database, , re-load such complex layout? objects need load , display saved. done ajax beyond i'm not sure best way proceed. examples might point me in right direction great.

much obliged.

you can serialize data via xml or json , save serialized string database. keep database , web service infrastructure simple having save each control separately require more parsing on js side, since app sounds js-heavy, assuming shouldn't problem you.

var state = {     textbox1:{         x:100,         y:200,         width:20,         height:10,         defaultvalue:'hello world!'     },     button1:{         x:150,         y:200,         width:20,         height:10,         text:'push me!'     } } var serialized = json.stringify(state); yourservice.savesate(serialized)   //made object mock web service 

json.stringify on modern browsers there plenty of alternatives around if targeting older stuff.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -