Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angularjs directive: connected support #1

Closed
bsr203 opened this issue Sep 16, 2013 · 6 comments
Closed

Angularjs directive: connected support #1

bsr203 opened this issue Sep 16, 2013 · 6 comments
Assignees

Comments

@bsr203
Copy link

bsr203 commented Sep 16, 2013

Thank you for maintaining the plugin, and the angular directive.
I was trying to make it work for the connected example, but not sure it is supported.
Can you please help with this question at SO, or treat this as a feature request

http://stackoverflow.com/questions/18836939/angularjs-directive-html5-dragable-list

thanks
bsr.

@ghost ghost assigned voidberg Sep 16, 2013
@voidberg
Copy link
Contributor

I'll take a look at it.

@bsr203
Copy link
Author

bsr203 commented Sep 16, 2013

@voidberg thanks for the quick response. I didn't set ng-model in the second example. Still, I am not sure how to maintain 2 models and somehow link them to enable drag-drop behavior.

@voidberg
Copy link
Contributor

No problem.

Connecting them is easy (see here http://plnkr.co/edit/k1Qxpz?p=preview ) however I'm not sure at first glance how I can check if the item is coming from another model or not. Will continue to dig.

@bsr203
Copy link
Author

bsr203 commented Sep 16, 2013

Thanks. I too could make the connect work without any modification. I think to maintain the integrity of the data, it has to be in one model (2 dimensional array) or maintain a unique id as part of the data.

In the sortupdate callback, what is the best way to get the id in our example. I am not an expert in jQuery, but saw data.item points to the html element. May be that is one way to identify the element.

@voidberg
Copy link
Contributor

I think I got it working. I'm not sure if it's the best way since I'm still learning Angular but you can find a version that works here: http://plnkr.co/edit/k1Qxpz?p=preview

I'll upload the changes to the repo too soon.

@voidberg
Copy link
Contributor

A more cleaned version is now available in the repository along with some AngularJS examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants