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

  • 相关阅读:
    完全背包
    二分求值(二分适合求答案在两个数之间的题目)
    set<pair<int,int> >的用法
    01背包 (dp专题)
    矩阵快速幂
    BZOJ1977 [BeiJing2010组队]次小生成树 Tree
    BZOJ1854 [Scoi2010]游戏
    BZOJ1054 [HAOI2008]移动玩具
    NOIP系列复习及题目集合
    BZOJ2708 [Violet 1]木偶
  • 原文地址:https://www.cnblogs.com/jayruan/p/5940877.html
Copyright © 2020-2023  润新知