X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/d41dc04ad17d1d9125fb2cf72db2b4782dbe3a8c..6b044c28b5f26fb99c86c237ffad19741c0f7f3d:/docs/output/Ext.util.DelayedTask.html?ds=inline diff --git a/docs/output/Ext.util.DelayedTask.html b/docs/output/Ext.util.DelayedTask.html index f6a31392..5364a999 100644 --- a/docs/output/Ext.util.DelayedTask.html +++ b/docs/output/Ext.util.DelayedTask.html @@ -1,97 +1,26 @@ -
-
- Properties - Methods - Events - Direct Link -
-

Class Ext.util.DelayedTask

- - - - - -
Package:Ext.util
Defined In:DelayedTask.js
Class:DelayedTask
Extends:Object
-
- * -Provides a convenient method of performing setTimeout where a new -timeout cancels the old timeout. An example would be performing validation on a keypress. -You can use this class to buffer -the keypress events for a certain number of milliseconds, and perform only if they stop -for that amount of time.
- -
- -

Public Properties

-
This class has no public properties.
-

Public Methods

- - - - - - - - - - - - - - - - - - - - -
MethodDefined By
- -

Public Events

-
This class has no public events.
-
\ No newline at end of file +
Properties Methods Events Direct Link

Class Ext.util.DelayedTask

Package:Ext.util
Defined In:DelayedTask.js
Class:DelayedTask
Extends:Object

The DelayedTask class provides a convenient way to "buffer" the execution of a method, +performing setTimeout where a new timeout cancels the old timeout. When called, the +task will wait the specified time period before executing. If durng that time period, +the task is called again, the original call will be cancelled. This continues so that +the function is only called a single time for each iteration.

+

This method is especially useful for things like detecting whether a user has finished +typing in a text field. An example would be performing validation on a keypress. You can +use this class to buffer the keypress events for a certain number of milliseconds, and +perform only if they stop for that amount of time. Usage:

var task = new Ext.util.DelayedTask(function(){
+    alert(Ext.getDom('myInputField').value.length);
+});
+// Wait 500ms before calling our function. If the user presses another key 
+// during that 500ms, it will be cancelled and we'll wait another 500ms.
+Ext.get('myInputField').on('keypress', function(){
+    task.delay(500); 
+});
+

Note that we are using a DelayedTask here to illustrate a point. The configuration +option buffer for addListener/on will +also setup a delayed task for you to buffer events.

Public Properties

This class has no public properties.

Public Methods

MethodDefined By

Public Events

This class has no public events.
\ No newline at end of file