The list page in the background moves down one position in the order, and then drops one position in the order. then, the foreground changes at the same time. how can this problem be achieved?

Source: Internet
Author: User
In the back-end list page, one place is moved up in the order, and one place is dropped when the point is dropped, and the front-end changes at the same time. how can this be implemented? In the back-end list page, one place is moved up in the order, and one place is dropped when the point is dropped, and the front-end changes at the same time. how can this be implemented? For more information, thank you! ------ Solution ------------------ the database has this field or time field, and the list is displayed as the list page of the orderby field background. in the order, point up and move up one bit, point drop will drop one, and then the foreground will change at the same time. how can this be achieved?
In the back-end list page, one place is moved up in the order, and one place is dropped when the point is dropped, and the front-end changes at the same time. how can this be implemented? For more information, thank you!

------ Solution --------------------
The database has this field or time field,

The list displays the order by field

Each time you click, it is actually to update the information of a single data or modify its field value,

Then return to the list.

For example, you have a list and each field information has a cn_time (time) or cn_index (value) field. [by the way, index is a keyword in the database]


Select * from list order by cn_time


Every time you click, the resource id data is updated.

Update list set cn_time = now;



In this way, the functions you mentioned are implemented,

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.