Class Ext.util.DelayedTask
Package: | Ext.util |
Class: | DelayedTask |
Extends: | Object |
Defined In: | DelayedTask.js |
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.
属性
-
方法
-
事件
公共属性
此类没有公共属性。
公共方法
|
DelayedTask([Function fn ], [Object scope ], [Array args ]) |
DelayedTask |
The parameters to this constructor serve as defaults and are not required. |
|
cancel() : void |
DelayedTask |
Cancel the last queued timeout |
|
delay(Number delay , [Function newFn ], [Object newScope ], [Array newArgs ]) : void |
DelayedTask |
Cancels any pending timeout and queues a new one |
公共事件
此类没有公共事件。
构造函数
DelayedTask
public function DelayedTask([Function fn
], [Object scope
], [Array args
])
The parameters to this constructor serve as defaults and are not required.
参数:
fn
: Function(可选) The default function to timeout
scope
: Object(可选) The default scope of that timeout
args
: Array(可选) The default Array of arguments
方法详情
cancel
public function cancel()
Cancel the last queued timeout
This method is defined by DelayedTask.
delay
public function delay(Number delay
, [Function newFn
], [Object newScope
], [Array newArgs
])
Cancels any pending timeout and queues a new one
参数:
delay
: NumberThe milliseconds to delay
newFn
: Function(可选) Overrides function passed to constructor
newScope
: Object(可选) Overrides scope passed to constructor
newArgs
: Array(可选) Overrides args passed to constructor
返回:
This method is defined by DelayedTask.