| createCallback()
- :
- FunctionCreates a callback that passes arguments[0], arguments[1], arguments[2], ...
+ Package: | Global | Defined In: | Ext.js,
Ext-more.js | Class: | Function | Extends: | Object | |
These functions are available on every Function object (any JavaScript function). Public PropertiesThis class has no public properties. Public Methods|
| createCallback()
+ :
+ FunctionCreates a callback that passes arguments[0], arguments[1], arguments[2], ...
Call directly on any function. Example:... Creates a callback that passes arguments[0], arguments[1], arguments[2], ...
Call directly on any function. Example: myFunction.createCallback(arg1, arg2)
Will create a function that is bound to those 2 args. If a specific scope is required in the
@@ -19,9 +19,9 @@ would simply execute immediately when the code is parsed. Example usage:
text: 'Say Hi',
renderTo: Ext.getBody(),
handler: sayHi.createCallback('Fred')
-}); | Function | | createDelegate( [Object obj ], [Array args ], [Boolean/Number appendArgs ] )
- :
- FunctionCreates a delegate (callback) that sets the scope to obj.
+}); | Function | | createDelegate( [Object scope ], [Array args ], [Boolean/Number appendArgs ] )
+ :
+ FunctionCreates a delegate (callback) that sets the scope to obj.
Call directly on any function. Example: this.myFunction.cr... Creates a delegate (callback) that sets the scope to obj.
Call directly on any function. Example: this.myFunction.createDelegate(this, [arg1, arg2])
Will create a function that is automatically scoped to obj so that the this variable inside the
@@ -42,13 +42,14 @@ callback points to obj. Example usage:
// This callback will execute in the scope of the
// button instance. Clicking the button alerts
// "Hi, Fred. You clicked the "Say Hi" button."
-btn.on( 'click', sayHi.createDelegate(btn, [ 'Fred'])); Parameters:obj : Object(optional) The object for which the scope is set args : Array(optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) appendArgs : Boolean/Number(optional) if True args are appended to call args instead of overriding,
-if a number the args are inserted at the specified position Returns: | Function | | createInterceptor( Function fcn , [Object scope ] )
- :
- FunctionCreates an interceptor function. The passed fcn is called before the original one. If it returns false,
-the original... Creates an interceptor function. The passed fcn is called before the original one. If it returns false,
+btn.on( 'click', sayHi.createDelegate(btn, [ 'Fred'])); Parameters:scope : Object(optional) The scope (this reference) in which the function is executed.
+If omitted, defaults to the browser window. args : Array(optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) appendArgs : Boolean/Number(optional) if True args are appended to call args instead of overriding,
+if a number the args are inserted at the specified position Returns: | Function | | createInterceptor( Function fcn , [Object scope ] )
+ :
+ FunctionCreates an interceptor function. The passed function is called before the original one. If it returns false,
+the ori... Creates an interceptor function. The passed function is called before the original one. If it returns false,
the original one is not called. The resulting function returns the results of the original function.
-The passed fcn is called with the parameters of the original function. Example usage:
+The passed function is called with the parameters of the original function. Example usage:
var sayHi = function(name){
alert('Hi, ' + name);
}
@@ -62,9 +63,10 @@ sayHi('Fred'); // alerts "Hi, Fred"
});
sayHiToFriend('Fred'); // no alert
-sayHiToFriend('Brian'); // alerts "Hi, Brian"
| Function | | createSequence( Function fcn , [Object scope ] )
- :
- FunctionCreate a combined function call sequence of the original function + the passed function.
+sayHiToFriend( 'Brian'); // alerts "Hi, Brian"Parameters:fcn : FunctionThe function to call before the original scope : Object(optional) The scope (this reference) in which the passed function is executed.
+If omitted, defaults to the scope in which the original function is called or the browser window. Returns: | Function | | createSequence( Function fcn , [Object scope ] )
+ :
+ FunctionCreate a combined function call sequence of the original function + the passed function.
The resulting function retur... Create a combined function call sequence of the original function + the passed function.
The resulting function returns the results of the original function.
The passed fcn is called with the parameters of the original function. Example usage:
@@ -78,9 +80,10 @@ sayHi( 'Fred'); // alerts "Hi, Fred"
alert( 'Bye, ' + name);
});
-sayGoodbye( 'Fred'); // both alerts show | Function | | defer( Number millis , [Object obj ], [Array args ], [Boolean/Number appendArgs ] )
- :
- NumberCalls this function after the number of millseconds specified, optionally in a specific scope. Example usage:
+sayGoodbye( 'Fred'); // both alerts show | Function | | defer( Number millis , [Object scope ], [Array args ], [Boolean/Number appendArgs ] )
+ :
+ NumberCalls this function after the number of millseconds specified, optionally in a specific scope. Example usage:
var sa... Calls this function after the number of millseconds specified, optionally in a specific scope. Example usage:
var sayHi = function(name){
alert('Hi, ' + name);
@@ -96,5 +99,6 @@ sayHi.defer(2000, this, ['Fred']);
// execution of an anonymous function:
(function(){
alert('Anonymous');
-}).defer(100);
Parameters:millis : NumberThe number of milliseconds for the setTimeout call (if less than or equal to 0 the function is executed immediately) obj : Object(optional) The object for which the scope is set args : Array(optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) appendArgs : Boolean/Number(optional) if True args are appended to call args instead of overriding,
+}).defer(100); Parameters:millis : NumberThe number of milliseconds for the setTimeout call (if less than or equal to 0 the function is executed immediately) scope : Object(optional) The scope (this reference) in which the function is executed.
+If omitted, defaults to the browser window. args : Array(optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) appendArgs : Boolean/Number(optional) if True args are appended to call args instead of overriding,
if a number the args are inserted at the specified position Returns:
| Function |
Public EventsThis class has no public events.
\ No newline at end of file
|