On Thu, Dec 4, 2014 at 7:25 AM, Neha Agrawal <[email protected]> wrote:
> Hi friends,
> i have two list. I want to drag from one list to another list and i want to
> drag in same list.

I first tackled this at least 18 months ago using angular-ui-sortable,
but I found that in my use case it had terrible bugs where list items
would just disappear from the DOM. jQuery wants to do things by
splicing DOM, but ng-repeat wants you to splice the scope, and let it
handle the DOM updates. I initially solved this with a directive that
replicated the ng-repeat functionality with some additional logic for
handling drags, but over a year later I don't think this is the right
way to go.

The native Drag and Drop API basically just passes a key value store
from origin to destination where all keys are mime types, and all
values are strings. Usually what I want is not just a data point, but
a reference to the scope the data originated at so that I can interact
with original. I think this can be achieved with a directive that
looks up it's scope id, and includes that. I'm having trouble thinking
of a better way of telling it about a particular object path than
walking the tree of the scope, and comparing references until it gets
a path like $003['stuff']['myarray'][2] that can be converted to a
string with enough information to find the original in the DOM.

Once the Angular with native Drag and Drop is figured out I already
wrote a library to add that API to mobile. It needs documentation, and
tests still.
https://github.com/teknotus/html5-drag-drop-shim

-- 
teknotus (Take Notice)

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to