2

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

2
  • I think you could try this module : github.com/marceljuenemann/angular-drag-and-drop-lists I use it and he works well. Commented 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 :) Commented May 8, 2016 at 12:28

2 Answers 2

3

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.

enter image description here

enter image description here

Sign up to request clarification or add additional context in comments.

10 Comments

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
can't you create a plunker for this ?
what's a plunker please?? I didn't understand
Plunker is an online community for creating, collaborating on and sharing your web development ideas.plnkr.co/edit/?p=preview
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
|
1

This might be helpful try using this module

http://angular-dragdrop.github.io/angular-dragdrop/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.