Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Wrong items dropped in connected lists #139

Closed
garymazz opened this issue Mar 4, 2014 · 7 comments
Closed

Wrong items dropped in connected lists #139

garymazz opened this issue Mar 4, 2014 · 7 comments
Labels

Comments

@garymazz
Copy link

garymazz commented Mar 4, 2014

Dragged items land in the wrong place on target, usually Position 1 (index 0). Drag the element where the first drag was 'supposed' to land, the first element is dragged.

Sometimes the item from the wrong list is dropped.

See: http://jsfiddle.net/XS3dW/

Also clone does not work

@thgreasi
Copy link
Contributor

thgreasi commented Mar 4, 2014

You should move the repeater of the inner ol to the inner li. Also from the inner li you might better have to remove the id attribute, since I think its just a text and not binded to the repeaters item.
As of cloning, please use the search of this repos issues. I think its the last issue answered #138.

@garymazz
Copy link
Author

garymazz commented Mar 4, 2014

Thanks, moving ng-repeat to the inner li fixed the issue. I can see why it appeared to almost work and was incorrect. It may require some additional documentation in the readme to explain where jquery's ().sortable is assigned in relation to the ui-sortable element and the repeat. It would avoid a beginner's coding errors, like mine.

Ok got the clone from #138. If I could make a suggestion, the code for the "no drop" and the clone should be built into directive.

@thgreasi
Copy link
Contributor

thgreasi commented Mar 4, 2014

By the next version, I would probably re-validate the clone functionality to be on par with jqueryui. I thought the example would be simpler.
As of dropping, its better to use the connectWith option only for the source list. That way there inter-list drop would work only one way.

I'm going to update this example as soon as the next version is ready.

Also, should this ticket be considered resolved?

@garymazz
Copy link
Author

garymazz commented Mar 4, 2014

Thanks. Close the ticket :) I'd like to keep the dialogue on your directive moving. Can you join the angularjs google group ? I'm trying to figure out generalized DnD/cut/paste framework to tie into jquery.

Sent from my iPhone

On Mar 4, 2014, at 9:57 AM, Thodoris Greasidis notifications@github.com wrote:

By the next version, I would probably re-validate the clone functionality to be on par with jqueryui. I thought the example would be simpler.
As of dropping, its better to use the connectWith option only for the source list. That way there inter-list drop would work only one way.

I'm going to update this example as soon as the next version is ready.

Also, should this ticket be considered resolved?


Reply to this email directly or view it on GitHub.

@thgreasi
Copy link
Contributor

thgreasi commented Mar 4, 2014

I just found an jquery-ui issue that has a drop-clone example. It seems that jquery-ui does not provide a simple way to do this. In my opinion restoring the ng-model looks less like the trickery magic the jquery-ui example shows.
Also created a new pen, removing update&stop() in favor or (properly) utilizing the connectWith option.

@thgreasi thgreasi closed this as completed Mar 4, 2014
@garymazz
Copy link
Author

garymazz commented Mar 5, 2014

Jquery provides a good tool set to manipulate the html dom. However, it
does not always provide the best solution to manipulate the data that
creates the html dom. The later portion is where angularjs excels and
provides the syntactic candy and programming advantage.

I like the new version of the example.. its much simpler to implement an
much easier to understand.

email garym at oedata dot com

On Tue, Mar 4, 2014 at 2:08 PM, Thodoris Greasidis <notifications@github.com

wrote:

Closed #139 #139.

Reply to this email directly or view it on GitHubhttps://github.com//issues/139
.

@thgreasi
Copy link
Contributor

Since the drop-clone example mentioned above has changed, just for future reference, I'm adding this fiddle to demonstrate what helper: 'clone' + connectWith actually do by themselves.

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

No branches or pull requests

2 participants