Closed josh4car closed 11 years ago
So I have serialize_params saving to a database...great. How do I then use my saved array to build the actual gird on page load? Any suggestions?
My code:
var gridster = $(".gridster ul").gridster({ widget_margins: [5, 10], widget_base_dimensions: [150, 160], min_cols: 2, max_cols: 6, serialize_params: function($w, wgd) { return { id: wgd.el[0].id, col: wgd.col, row: wgd.row, size_x: wgd.size_x, size_y: wgd.size_y }; }, draggable: { handle: '.handle', stop: function(event, ui) { var positions = JSON.stringify(gridster.serialize()); $.ajax({ url : ROOT + '_ajax/save_ad_dash_cards.php', data : {'cards' : positions}, type : 'POST', success : function(data) { console.log(data); } }); } } }).data('gridster');
http://gridster.net/demos/grid-from-serialize.html
So I have serialize_params saving to a database...great. How do I then use my saved array to build the actual gird on page load? Any suggestions?
My code: