Jquery Sortable Updated Data Not Being Serialized
I am using the jQuery Sortable plugin. Looking at the basic example on how to serialize the data I have the below code.
So the reason is that the data is cached by jQuery.
The solution:
var group = $("ol.serialization").sortable({
group: 'serialization',
delay: 500,
onDrop: function (item, container, _super) {
group.children().each(function(){
jQuery._data(this, 'parsedAttrs', false);
jQuery.removeData(this);
});
var data = group.sortable("serialize").get();
var jsonString = JSON.stringify(data, null, ' ');
console.log(jsonString);
$('#serialize_output2').text(jsonString);
_super(item, container)
}
})
This fiddle: http://jsfiddle.net/hb6hU/1/
Post a Comment for "Jquery Sortable Updated Data Not Being Serialized"