Not getting gridster serialize data after resizing the boxes

邮差的信 提交于 2019-12-05 22:45:29

Try This:

 var gridster = $(".gridster > ul").gridster().data('gridster');
                     gridData = gridster.serialize();  
             $('.js-seralize').on('click', function() {
                   // alert(gridData.toSource())
                   var finalserializer="[";
                   $('.re_boxes').each(function(){
                    var xaxisval = $(this).attr("data-sizex");
                    var yaxisval = $(this).attr("data-sizey");
                    var colval = $(this).attr("data-col");
                    var rowval = $(this).attr("data-row");
                    var coltitle = $(this).find("a").text();
                    var currentfinal = "{'col':"+colval+",'row':"+rowval+",'size_x':"+xaxisval+",'size_y':"+yaxisval+",'text:'"+coltitle+"}";
                    finalserializer = finalserializer+currentfinal;
                   });
                   finalserializer=finalserializer+"]";
                   alert(finalserializer);
                 });
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!