How do I move up and down the data in the list?

Source: Internet
Author: User
Tags processing text
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?


Reply to discussion (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

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 statement +1, but the service side of the data in sequence emissions, this demand, a little unclear so AH

Save the ID in the appropriate row data.

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 and pass the ID value of B and a to the processing file. But now do not know how to achieve the operation of Click B, while the ID of a pass through. In brief, how to get the ID of a while operating B.

Reference 1 Floor Hellodifa reply: 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

Reference 1 Floor Hellodifa reply: 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 ~

  • 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.