ボックスのサイズと位置を変更した後、JSON データをシリアライズしようとしています。しかし、ロード中の詳細のみを取得します。ボックスのサイズを変更した後にデータをシリアル化する方法。また、ボックスのテキスト(ボックス内の値)も取得したいと思います。
これは私のコードです:
$(function() {
var gridster = $(".gridster > ul").gridster({
widget_margins: [10, 10],
widget_base_dimensions: [230, 160],
helper: 'clone',
resize: {
enabled: true,
},
serialize_params: function($w, wgd) {
return {
text: $($w).attr('.drop'),
col: wgd.col,
row: wgd.row,
size_x: wgd.size_x,
size_y: wgd.size_y
};
}
}).data('gridster');
//serialization//
var gridster = $(".gridster > ul").gridster().data('gridster');
gridData = gridster.serialize();
/*alert(gridData.toSource())*/
$('.js-seralize').on('click', function() {
alert(gridData.toSource());
});
//delete//
$(".del_img").click(function() {
gridster.remove_widget($(this).parent());
});
});
助けてください。
前もって感謝します。