ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.03k stars 1.2k forks source link

How to save the new added widget's state #315

Closed PoojaSSW closed 10 years ago

PoojaSSW commented 10 years ago

I added a new widget using this function mentioned in the gridster documentation: $('.js-resize-random').on('click', function() { gridster.add_widget('

  • The new widget...
  • ', 2, 2); });

    I want to save the state after adding this new widget, so that on refresh I should be able to see this added widget on display. Any ideasss????

    Thanks

    davidpelayo commented 10 years ago

    On refreshing your browser you mean or... what exactly?

    vieron commented 10 years ago

    You should get widget positions with gridster.serialize(), store them somewhere (db, cookies, local storage...) and then add widgets one by one to the grid like in the Build from serialize example