I'm trying to use drag and drop feature in my application, I downloaded the drag and drop module which can be found here: https://github.com/a5hik/ng-sortable , I need to use a simple example exactly like this: http://a5hik.github.io/ng-sortable/#/kanban I don't know how to use it, If I need to download another thing. Thanks in advance for your help
-
I think you could try this module : github.com/marceljuenemann/angular-drag-and-drop-lists I use it and he works well.Eliot– Eliot2016-05-01 16:37:43 +00:00Commented May 1, 2016 at 16:37
-
@FlorianB please I did with the exemple you show me, and I haven't the drag and drop effect, I don't know what's a mistake, please help me :( can you please take a look in what I did, I put it in github that you can see github.com/alyssaMel/angular.git thanks in advance :)Alyssa– Alyssa2016-05-08 12:28:28 +00:00Commented May 8, 2016 at 12:28
Add a comment
|
2 Answers
Update : Here is simple working example : Plunker
Just follow the steps which this link mentioend.
Step 1 : Make sure to load the scripts in your html
<script type="text/javascript" src="dist/ng-sortable.min.js"></script>
<link rel="stylesheet" type="text/css" href="dist/ng-sortable.min.css">
<!-- OPTIONAL: default style -->
<link rel="stylesheet" type="text/css" href="dist/ng-sortable.style.min.css">
Step 2 : And Inject the sortable module as dependency
angular.module('xyzApp', ['as.sortable', '....']);
Step 3 : Invoke the Directives using below html structure
Html
<ul data-as-sortable="board.dragControlListeners" data-ng-model="items">
<li data-ng-repeat="item in items" data-as-sortable-item>
<div data-as-sortable-item-handle></div>
</li>
</ul>
Step 4 : Define your callbacks in the invoking controller
JS
$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.
};
And you can inspect the exact example you have mentioned above by using F12 Key.
10 Comments
Alyssa
PS: thank you for replying @Sampath I tried to follow instructions but I still haven't the drag and drop effect github.com/alyssaMel/dragAndDrop.git Can you tike a look of what I did please and thanks in advance
Sampath
can't you create a
plunker for this ?Alyssa
what's a plunker please?? I didn't understand
Sampath
Plunker is an online community for creating, collaborating on and sharing your web development ideas.plnkr.co/edit/?p=preview
Alyssa
thank you for your help brother I put it on plunker, plnkr.co/edit/T52QqdP7EXOZDwFTMKfe?p=preview this is a link and in app.js I think that I haven't complete or I made a mistake in
|

