mercredi 28 janvier 2015

Ember save option (serialized data to localstore)

I'm trying to implement a save option for some serialized ember component data. I have no idea where to start or how to save/load this data.


Found a way by implenting an adapter or using the github ember localstorage adapter. But I'm not familiar with localstorage or adapters.



export default Ember.Component.extend({
tagname: "",

Draglayout: function(){
widget_base_dimensions: [359, 232],
widget_margins: [5, 5],
helper: 'clone',
resize: {
enabled: true,
max_size: [3, 3],
min_size: [1, 1],
stop: function (e, ui, $widget) {
var widget_base_dimensions = this.serialize($widget)[0];
}
},
serialize_params: function($w, wgd) {
return {
col: wgd.col,
row: wgd.row,
size_x: wgd.size_x,
size_y: wgd.size_y
};
}
}.on("didInsertElement")
});




Aucun commentaire:

Enregistrer un commentaire