How to move data down and up in the list

Source: Internet
Author: User
How does one implement the data move up and down functions in the list? How does one implement the data move up and down functions in the list? The sort field is set in the database for mobile sorting. when this field is added, the creation timestamp is used by default, and the list is sorted by creation time in reverse order by default. What I want now is how to get the upstream or downstream data id & nbsp; on the page ;? ------ Solution ---------------- how can I implement the functions of moving data up and down in the list?
How does one implement the data move up and down functions in the list?
The sort field is set in the database for mobile sorting. when this field is added, the creation timestamp is used by default, and the list is sorted by creation time in reverse order by default.
How can I obtain the upstream or downstream data id on the page?


------ Solution --------------------
Save the sort field as 1 2 3 4...
Then move 2 down and you will change 2 to 3 and 3 to 2 ~
Two data statements
------ Solution --------------------
Reference:
Reference: the sort field is saved as 1 2 3 4 according to the creation time...
Then move 2 down and you will change 2 to 3 and 3 to 2 ~
Two data statements
Data id operation
A 1 move up and down
B 2 move up and down
C 3 move up and down
My idea is to click B's move up, and then pass the id values of B and a to review the text ......

This is a page operation, implemented using js
------ Solution --------------------
Reference:
Reference: the sort field is saved as 1 2 3 4 according to the creation time...
Then move 2 down and you will change 2 to 3 and 3 to 2 ~
Two data statements
Data id operation
A 1 move up and down
B 2 move up and down
C 3 move up and down
My idea is to click B's move up, and then pass the id values of B and a to review the text ......

After you click the button, you need to send ajax asynchronous operations to ensure that the page is not refreshed and the up-shift effect is achieved ~

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.