get sEcho with bServerSide = false and sAjaxSource and fnReloadAjax

get sEcho with bServerSide = false and sAjaxSource and fnReloadAjax

JanSJanS Posts: 2Questions: 0Answers: 0
edited August 2013 in General
First thanks for this great jQuery add-on :)

I build a web phonebook for my company (querying LDAP). So I have some filter fields in a form submitted to php. The results are displayed with DataTables. But LDAP doesn't support good paging or sorting, so I turnded off bServerSide and call fnReloadAjax on every input change to get the data.

The problem is if I filter for eg surname beginning with "an" 2 change events are firing (one for "a" one for "an") the second request will get answered faster and displayed first. Then the big answer of the first request will come back and overrides the right answer.
So typing slowly "an" will display the results of the "a" search.

sEcho would solve this problem but i need bServerSide = false for sorting and paging on client side.

Any solution?

Replies

  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    You might want to consider putting a debounce in, or implementing your own version of sEcho (which is just a draw counter, so solve exactly the issue you are seeing). When in client-side processing mode, the table is synchronous so there is no concept of rebound built in at that point.

    Allan
  • JanSJanS Posts: 2Questions: 0Answers: 0
    Ok I have no clue how to write a good client friendly debounce, so I will write my own sEcho.

    I whink I will use a global JS var sEcho and I will only run ClearTable+AddData if the response sEcho is equal the JS sEcho.
This discussion has been closed.