Giter Club home page Giter Club logo

Comments (7)

codef0rmer avatar codef0rmer commented on August 20, 2024

I could not understand exactly whats the issue is. Can you make a demo on jsfiddle.net?

from angular-dragdrop.

cirdes avatar cirdes commented on August 20, 2024

http://jsfiddle.net/cirdes/sHzma/

This is a basic example to show the issue. If you drag the first box and change it's position with the third box when the stop callback is fired my list still ["one", "two", "three", "four", "five", "six"] but it supposed to be ["three", "two", "one", "four", "five", "six"]

from angular-dragdrop.

codef0rmer avatar codef0rmer commented on August 20, 2024

Okay. That is because in jQueryUI, draggable's stop event fires before drop event. What exactly are you trying to do with this?

from angular-dragdrop.

cirdes avatar cirdes commented on August 20, 2024

@codef0rmer, every element on my list represents an model in my backend. An user reorder the list by dragging the elements and the next time he visits the page, the list are on the same order that he left.

I was using the stopCallback to send the current order to my server.

from angular-dragdrop.

codef0rmer avatar codef0rmer commented on August 20, 2024

Why do not you then send the current order to your backend on drop event?

Still if you want to send the data from stopCallback, put a timer there... send data after a second or so (but it wont be accurate because I'm passing 'fast' to animate function)

from angular-dragdrop.

cirdes avatar cirdes commented on August 20, 2024

You are right, i just change the callback to drop event and now is working fine.
http://jsfiddle.net/cirdes/sHzma/1/

Thanks

from angular-dragdrop.

codef0rmer avatar codef0rmer commented on August 20, 2024

Glad it worked. :-)

from angular-dragdrop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.