Coder Social home page Coder Social logo

Comments (9)

freekmurze avatar freekmurze commented on May 16, 2024

How are you reordering items?

from eloquent-sortable.

cvassios-ekko avatar cvassios-ekko commented on May 16, 2024

I'm not sure I understand your question. I'm using this repo to do drag and drop
screen shot 2017-10-17 at 3 07 34 pm

from eloquent-sortable.

freekmurze avatar freekmurze commented on May 16, 2024

What info is sent to the server?

from eloquent-sortable.

cvassios-ekko avatar cvassios-ekko commented on May 16, 2024

The column "order" in my database

from eloquent-sortable.

freekmurze avatar freekmurze commented on May 16, 2024

What code do you use to update the order? What data is passed to that code?

from eloquent-sortable.

cvassios-ekko avatar cvassios-ekko commented on May 16, 2024

I'm showing all the code I have related to this. I just followed what I could use from the README instructions. Where can I find an example of code I can use to update and pass data?

from eloquent-sortable.

freekmurze avatar freekmurze commented on May 16, 2024

There's an example in the readme:

/**
 * the record for model id 3 will have record_column value 1
 * the record for model id 1 will have record_column value 2
 * the record for model id 2 will have record_column value 3
 */
MyModel::setNewOrder([3,1,2]);

Make sure you pass the right values to setNewOrder.

from eloquent-sortable.

cvassios-ekko avatar cvassios-ekko commented on May 16, 2024

So if I have a hundred or more items, my setNewOrder would have to be an array of all those items?

And if I want to move an item up or down multiple times I'd need a different setNewOrder for each move?

from eloquent-sortable.

freekmurze avatar freekmurze commented on May 16, 2024

So if I have a hundred or more items, my setNewOrder would have to be an array of all those items?

It would have to be an array with the ids of those items.

And if I want to move an item up or down multiple times I'd need a different setNewOrder for each move?

Yes

from eloquent-sortable.

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.