Closed skylord123 closed 3 years ago
This looks really good to me - thanks. When I merge it in it will go through our unit tests.
Are you happy for this to be included under the MIT license?
Are you happy for this to be included under the MIT license?
Yes, that is perfectly fine :)
…ring the first.
settings.bAjaxDataGet
variable (now unnecessary as this needs to be tracked per each ajax request not globally)I'm going to copy the description from https://github.com/DataTables/DataTables/pull/1083 since I accidentally create that PR before this correct one:
I was having issues when my users would fill out the filter column fields at the top of a table I have it set to filter on the change event of the text fields. When they would enter one value in a filter field, tab to the next value, enter a search value and press enter before the first request finishes (our tables are pretty large so requests take a few seconds). it would only filter what the user put in the first field and would drop subsequent requests until the first request finishes.
I traced it down to these lines of code. If multiple ajax requests happen the _fnDraw will drop the subsequent requests. This is because the _fnDraw function calls _fnAjaxUpdate to get the ajax data then once that data is available it calls _fnDraw again and this time it renders the content because settings.bAjaxDataGet is true.
Instead of storing the ajax request state in a variable on the datatable object it should instead only be used for that single ajax request so it doesn't break concurrency.