From 2c4cc4fd1b86612c6c8682abf17a028afa15c862 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Wed, 5 Feb 2014 10:32:21 +0000 Subject: [PATCH] New: Built in filtering will throttle calls to the server when using server-side processing - A popular plug-in for DataTables is the `fnSetFilteringDelay` plug-in, which provides a bit of a buffer when typing into the filter input so you don't make an Ajax request for every key stroke - i.e. don't DDoS your own server! - Since we have _fnThrottle built in now for the scrolling, we can also use it to provide this buffering functionality for server-side processing filtering in the core. A couple of small changes for _fnThrottle were required to get the callback context correct and ot call it not immediately, but only after the delay --- .datatables-commit-sync | 2 +- media/js/jquery.dataTables.js | 68 ++++++++++++++++++++++------------- 2 files changed, 44 insertions(+), 26 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index f473aa11..7caa7b83 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -38e760a00f96112e374d286ba7302065abc07733 +a931f2b4aeb3f699cbda26245bdc590079044eed diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index f4f9ddac..da4fca2f 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -2552,27 +2552,33 @@ } ) .append( $('