http://rubaxa.github.io/Sortable/Sortable.js

http://rubaxa.github.io/Sortable/Sortable.min.js
http://rubaxa.github.io/Sortable/ng-sortable.js
http://rubaxa.github.io/Sortable/
https://github.com/RubaXa/Sortable

<script src="js/Sortable.min.js"></script>
<script src="js/ng-sortable.js"></script>
<div ng-sortable="sortableConfig">
<div>1</div>
<div>2</div>
<div>3</div>
</div>

$scope.conponOrderby=function(n){
var json=angular.copy($scope.paramsData);
timer=$timeout(function(){

json.sortJson={};

angular.forEach($scope.sortList,function(v,e){
json.sortJson[v._id]=e+1;

})
console.log("=22222");
$scope.sortList=[];
var currentUrl=baseHref+"coupons/sort/all";
$http({ method:"PUT",url: currentUrl,
headers: { 'Content-Type': 'application/json; charset=UTF-8'},
data:json
}).success(function(data){

});
},n)



}

$scope.sortableConfig = { animation: 750,
onEnd: function(list) {
$scope.sortList=list.models;
$timeout.cancel(timer);
$scope.conponOrderby(2000);
}
};

node:
var sortJson = info.sortJson;

coupons.find(where, function(err, data) {
if (err) return next(err);
data.forEach(function(value, key) {
if (sortJson[value._id]) {
value.order = sortJson[value._id];
value.save();
}

})
res.json(returnData);
});

sorttable的更多相关文章

  1. javascript 表格排序和表头浮动效果(扩展SortTable)

    前段时间一个项目有大量页面用到表格排序和表头浮动的效果,在网上找了几个表格排序的js代码,最后选择了 Stuart Langridge的SortTable,在SortTable基础上做了些扩展,加上了 ...

  2. jquery sortTable拖拽排序

    所有的事件回调函数都有两个参数:event和ui,浏览器自有event对象,和经过封装的ui对象   ui.helper - 表示sortable元素的JQuery对象,通常是当前元素的克隆对象   ...

  3. Jquery.Sorttable 桌面拖拽自定义

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...

  4. SQL存储过程分页(通用的拼接SQL语句思路实现)

    多表通用的SQL存储过程分页 案例一: USE [Community] GO /****** Object: StoredProcedure [dbo].[Common_PageList] Scrip ...

  5. sqlserver 通用分页存储过程(转)

    USE [AAA_TYDC] GO /****** Object: StoredProcedure [dbo].[proc_DataPagination] Script Date: 11/20/201 ...

  6. ueditor 百度编辑器,取消或自定义右键菜单

    如图:有2种自定义方法,一种是改源码,一种是初始化 初始化,如下代码: var ue = UE.getEditor('XXXid',{ // contextMenu:[ {label:'', cmdN ...

  7. Sql Server 数据分页

    http://www.cnblogs.com/qqlin/archive/2012/11/01/2745161.html 1.引言 在列表查询时由于数据量非常多,一次性查出来会非常慢,就算一次查出来了 ...

  8. easy ui 零散技巧

    1.Jquery带上下文查找: 格式:$(selector,context) 例如:$("input",window.document),查找当前文档下的说有input元素,也等价 ...

  9. JS实现表格排序

    今天有点闲,写个小东西,使用JS实现点击表格标题栏实现自动排序功能,嘻嘻... 一.JS代码,文件名为code.js如下: (function($){ //插件 $.extend($,{ //命名空间 ...

随机推荐

  1. 《zw版·Halcon-delphi系列原创教程》 Halcon分类函数011,ocr,字符识别

    <zw版·Halcon-delphi系列原创教程> Halcon分类函数011,ocr,字符识别 为方便阅读,在不影响说明的前提下,笔者对函数进行了简化: :: 用符号“**”,替换:“p ...

  2. html5,output标签应用举例

    <form action="" id="myform" oninput="num.value=parseInt(num1.value)+pars ...

  3. springmvc 组合注解

    组合注解的意思就是一个注解中包含多个注解.在springmvc 的@RestController中,你就可发现. @Target(ElementType.TYPE) @Retention(Retent ...

  4. Your pain

    Your pain is the breaking of the shell that encloses your understanding. 你的痛苦是你那包裹知识的皮壳的破裂.

  5. PostgreSQL Hot Standby的主备切换

    一. 简介:          PG在9.*版本后热备提供了新的一个功能,那就是Stream Replication的读写分离,是PG高可用性的一个典型应用.其中备库是只读库:若主库出现故障:备库这个 ...

  6. Oracle分组排序查询

    用sql查询每个分组中amount最大的前两条记录: SELECT *FROM HW trWHERE(SELECT COUNT(*) FROM HW WHERE tr.DEPID=DEPID AND ...

  7. python(六)内置函数

    一.函数知识补充 函数不设置值,默认返回None:函数中参数都是按引用传递,函数里修改了参数,原始参数也会修改. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 ...

  8. [问题2014A06] 复旦高等代数 I(14级)每周一题(第八教学周)

    [问题2014A06]  若 \(n\) 阶实方阵 \(A\) 满足 \(AA'=I_n\), 则称为正交矩阵. 证明: 不存在 \(n\) 阶正交矩阵 \(A,B\) 满足 \(A^2=cAB+B^ ...

  9. 深度优先搜索(DFS)

    定义: (维基百科:https://en.wikipedia.org/wiki/Depth-first_search) 深度优先搜索算法(Depth-First-Search),是搜索算法的一种.是沿 ...

  10. ExceptionExtensions

    public static class ExceptionExtensions { public static IEnumerable<Exception> GetAllException ...