Commit dfe8ec23 authored by Nicolas Widart's avatar Nicolas Widart Committed by GitHub

Merge pull request #379 from hoyvoy/3.0

Solution for this.spawn_widget is not a function
parents 8c2025c5 aa68b025
...@@ -65,9 +65,10 @@ ...@@ -65,9 +65,10 @@
this.grid = jQuery('.grid-stack').data('gridstack'); this.grid = jQuery('.grid-stack').data('gridstack');
this.load_grid = function () { this.load_grid = function () {
this.grid.remove_all(); this.grid.remove_all();
var grid = this;
var items = GridStackUI.Utils.sort(this.serialized_data); var items = GridStackUI.Utils.sort(this.serialized_data);
_.each(items, function (node) { _.each(items, function (node) {
this.spawn_widget(node); grid.spawn_widget(node);
jQuery(jQuery.find('option[value="'+node.id+'"]')[0]).hide(); jQuery(jQuery.find('option[value="'+node.id+'"]')[0]).hide();
}, this); }, this);
}.bind(this); }.bind(this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment