zoukankan      html  css  js  c++  java
  • sorttable

    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);
    });

  • 相关阅读:
    假设的立场
    Win32资源的使用
    printf()可变域宽输出
    C语言qsort()函数
    OSG-VS2013-X64编译
    Windows下64位SQLite3.10动态库编译
    linux常用命令-个人收藏
    MongoDB3.0安装
    nginx+fastcgi+spawn-fcgi
    linux中codeblocks程序编译运行后不出现控制台窗口
  • 原文地址:https://www.cnblogs.com/jayruan/p/5940877.html
Copyright © 2011-2022 走看看