How to implement the Move down and move up functions of data in a list

Source: Internet
Author: User
Tags processing text
How do I move up and down the data in the list?
How do I move up and down the data in the list?
Move the sort, the database set the Sort field, this field is added by default is the creation timestamp, the list default is by the creation time in reverse order.
Now I'm thinking how to get the data ID of the uplink or downlink in the page?


------Solution--------------------
The sort field is saved as 1 2 3 4 by creation time ...
And then 2 down you let 2 turn 3 3 into 2 then you can.
Two data statements
------Solution--------------------

References:
Reference: The sort field is saved as 1 2 3 4 by creation time ...
And then 2 down you let 2 turn 3 3 into 2 then you can.
Two data statements
Data ID Operations
A 1 Move Up down
B 2 Move Up down
C 3 Move Up down
My idea is to click on B to move up, then pass the ID value of B and a to the processing text ...

This is the page operation, with JS to achieve
------Solution--------------------
References:
Reference: The sort field is saved as 1 2 3 4 by creation time ...
And then 2 down you let 2 turn 3 3 into 2 then you can.
Two data statements
Data ID Operations
A 1 Move Up down
B 2 Move Up down
C 3 Move Up down
My idea is to click on B to move up, then pass the ID value of B and a to the processing text ...

After clicking the button, it is to send Ajax asynchronous to operate, so that the page does not refresh, and to achieve the effect of moving up ~
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.