Why is not fnSetFilteringDelay built in?

Why is not fnSetFilteringDelay built in?

parkeparke Posts: 2Questions: 0Answers: 0
edited November 2010 in General
Regarding the fnSetFilteringDelay plug-in (http://datatables.net/plug-ins/api#fnSetFilteringDelay) ...

It seems to me that the vast majority of cases using server side filtering would benefit from a delay prior to each new filtering Ajax request being sent to the server. At present, each keystroke instantly sends a new request to the server. For example, if I filter on "Boston", six requests will be sent to the server, but only the last request will be used. This seems highly non-ideal.

So why isn't fnSetFilteringDelay built in to DataTables? It seems to me this would be a valuable feature.

Additionally, according to discussion #943 (link below) the current plug-in does not work for per-column filtering.

http://datatables.net/forums/comments.php?DiscussionID=943

Ideally, if I'm using server-side processing, the filtering delay should be built-in and automatically turned on (to a reasonable delay, say 500ms?) by default.

Replies

  • jonkjonk Posts: 8Questions: 0Answers: 0
    I was thinking that the delay should work like autocomplete, where the delay is triggered by keystrokes. This seems like something that should already be in the library.
  • GregPGregP Posts: 500Questions: 10Answers: 0
    I guess at some point, Allan has to draw the line between "core feature" and "plug-in", and that line can be a fuzzy one! The client-side processing people don't need the extra bytes of downloads, but the server-side people could benefit from not having to include it as a plug-in. Which side to accomodate?

    Easy to go too extreme and claim that ANY optional functionality could be a plug-in, and I wouldn't want to go that far. So it's just a matter of the line to be drawn.

    Me, I could go for having it included by default because I use primarily server-side. ;-)
  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin
    What Greg says :-). If bandwidth and processing power were free, all of the plug-ins would be included in the core - but this isn't possible, so a line needs to be drawn somewhere. I've decided that core functionality should provide basic API methods, but not duplicate which is already possible (i.e. same thing, different way). That should be done with a plug-in so if you use it, it can be added in.

    Of course, if everyone came to the forum and said "we need this feature" then I would look at adding it in by default, but the majority of DataTables use cases do not use that plug-in (the majority are client-side processing, so on-the-fly filtering works fine).

    Allan
This discussion has been closed.