can you go up the paging code, so you can't see it?
Don't sink.
should it be two requests, or should it be two requests, or one more time
?
I didn't look at the code carefully, but I judged that the problem occurred on your paging (next page, previous page) tag binding, or logically.
this kind of paging code is supposed to return only the current page data and the total page number information, the current page information on the server side.
you track the process of your request.
in fact, there is no difference between getting the area and getting the whole, just a few conditional switches.
< hr >
in fact, the reason why the landlord made a mistake is that the data and view are so deeply coupled that the logic of the whole process is not clear.
if I design a similar application, it looks like this
- the data is provided by the server, and the returned information includes information about Filter conditions and specific data
- data is received (feedback) by a set of status parameters. Filter status
- when requesting data from the server, the Filter condition is always set according to the status parameters
- after data acquisition, update the status parameters and update the view according to the data information
- Page switching processing triggers uniformly
< hr >
the corresponding pseudocode representation (note that there is only one such processing, and the rest is encapsulated in the getData function and the success method. )
dataConfig={ //
...
}
...
$.ajax{
url:""
type:"post",
data: getData(),// getData dataConfig
dataType:"json",
success:function(serverData){
// serverData
// serverData
}
}