后台有拖拽排序功能,然而前段在开发的时候,一整页的数据都发给后端了. 于是查看前端代码,想到了如下解决办法,即先把排序前的保存,然后对比排序后的,有差异的才发回给后端. var new_ids_order = []; var new_sort_order = []; for (i in old_ids_order) { if(old_ids_order[i] != ids_order[i]){ new_ids_order.push(ids_order[i]) new_sort_order.pus
拖拽后,地图直接消失了,而且右上角的坐标变成了NaN,NaN 后来经过测试发现,原来是自己封装有问题,坐标点一定要用parseFloat()转换下,但不清楚为什么页面刚开始加载的时候没有问题,总之能解决就好.代码如下: var centerXY = "121.5472412109375,29.88006591796875"; var centerObj = centerXY.split(','); var centerX = centerObj[0]; var centerY = ce
以自定义ImageView为例: /** * 可拖拽ImageView * Created by admin on 2017/2/21. */ public class FloatingImageView extends ImageView{ public FloatingImageView(Context context) { super(context); } public FloatingImageView(Context context, AttributeSet attrs) { su