ng-sortable-タッチスクリーンはドラッグアンドドロップソートをサポートします



Ng Sortable Touch Screen Support Drag



1.最初は https://github.com/a5hik/ng-sortable/tree/master/dist ファイルをダウンロードします:ng-sortable.min.js、ng-sortable.css、ng-sortable.style.css、およびプロジェクト内の参照

2.次のソート可能な依存性を注入します:angular.module('xyzApp', ['as.sortable', '....'])



3.使用法:






data.topicContentListリストは、表示するコンテンツの配列です。



dragControlListenersはソート関数です。

$scope.dragControlListeners = { // triggered when item order is changed with in the same column (what happens here) orderChanged: function (event) { // sort operation } }

4は、コントローラーで他のコールバック関数を定義することもできます。

$scope.dragControlListeners = { accept: function (sourceItemHandleScope, destSortableScope) {return boolean}//override to determine drag is allowed or not. default is true. itemMoved: function (event) {//Do what you want}, orderChanged: function(event) {//Do what you want}, containment: '#board'//optional param. clone: true //optional param for clone feature. allowDuplicates: false //optional param allows duplicates to be dropped. } $scope.dragControlListeners1 = { containment: '#board'//optional param. allowDuplicates: true //optional param allows duplicates to be dropped. }