SearchDelay doesn't works with drawCallback as expected

SearchDelay doesn't works with drawCallback as expected

MausinoMausino Posts: 61Questions: 19Answers: 0
edited August 2021 in Bug reports

Hello,

Here is the example.... http://live.datatables.net/yogevuka/1/edit

If i used searchDelay to 2 sec... on search.. first gave me all results in console and after the filtered result after 2 seconds

For example if you search Cox you first get all results and after 2 sec the only one...
Same issue if you remove by backspace the cox letters.. first you got two results (because search by "co" of results and after will see all results

Or is there something where i miss that is possible prevent first key-stroke which result bunch of results which i doesn't want?

If any question. Will here :)

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    Seems like this issue has been around for some time. There are a few threads discussing it like this and this. @allan can confirm for sure but I suspect there haven't been any changes and when he says "fixed in the next major version" he means Datatables 2.0 (speculation on my part though). Maybe one of the workaronds presented will meet your needs.

    Kevin

  • MausinoMausino Posts: 61Questions: 19Answers: 0

    Hi, @kthorngren i see that this issue is minimal 5 years old... no other way as use some workarounds... which is sad :(

    i think the best will from one link which you added here, that i will implement the time delay to initComplete ... but this affect all my queries to server.. because delay any request from datatables to server for all my DTs only because prevent bug of SearchDelay option...

    Datatables are great peace of sofware + with Editor even better... but this bug must somehow also affect the Cloudtables if use DT (don't see behind processes).

  • MausinoMausino Posts: 61Questions: 19Answers: 0

    @alan can i ask if this issue is on plan to fix for datatables?

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    Answer ✓

    Yes, this is unfortunately a long term issue. It most likely won't be fixed in 1.x, but will be addressed with v2. The idea of it originally was to give users immediate feedback that something is happening - but it hasn't really worked out very well!

    The workaround is to use your own search input box and set a throttle / debounce function in it.

    Allan

Sign In or Register to comment.