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

  • 相关阅读:
    HDU5343:MZL's Circle Zhou(SAM,记忆化搜索DP)
    动归皆背包——那些做过的背包
    CODEVS 3943 数学奇才琪露诺
    codevs 1540 银河英雄传说
    CODEVS 1004四子连棋
    洛谷1082 同余方程
    洛谷1006 传纸条
    洛谷1508 Likecloud-吃、吃、吃
    洛谷1108 低价购买
    洛谷1156 垃圾陷阱
  • 原文地址:https://www.cnblogs.com/jayruan/p/5940877.html
Copyright © 2011-2022 走看看