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.
How can I obtain the upstream or downstream data id on the page?
Reply to discussion (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
Save the sort field as 1 2 3 4...
Then move 2 down and you will change 2 to 3 and 3 to 2 ~
The two DATA statements + 1, but the server releases the data in sequence. this requirement is unknown.
Save the id in the corresponding row data.
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
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 the processing file. However, I do not know how to click B and pass the id of. To put it simply, how to obtain the id of a while operating B.
Reference the reply from hellodifa on the first floor: the sort field is saved as 1 2 3 4 at 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
Reference the reply from hellodifa on the first floor: the sort field is saved as 1 2 3 4 at 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 ~