Table list requests data and returns out of order

background description:
there is an existing table, that contains paging. The query function
data is requested from ajax. The function for requesting table list is getUserList ()
Fuzzy matching is completed by the background, and the front end passes keywords in getUserList () to pull the data. The search box is input, binding @ input function call data

.

now there is a problem:
because of the large amount of data, when using @ input request, the request is sent many times. Because it is asynchronous, the request with a small amount of data is returned first, and the request with a large amount of data is returned later, resulting in the confusion of the front-end page data, and the query conditions do not correspond to the queried data

.

excuse me:
what should I do to solve the above problem at this time?

Mar.24,2021

two methods for reference:

  1. Don't send a request directly in @ input, consider sending it after you enter to reduce unnecessary requests.
  2. Save the current search term before the request. After receiving the reply, compare whether the current search term is the search term for this request. If it is not, discard it directly, because the latest search term is bound to trigger a new request, so just wait.

can be set to Synchronize async:false Synchronize execution is a request execution play will execute the next

Menu