X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6746dc89c47ed01b165cc1152533605f97eb8e8d..f562e4c6e5fac7bcb445985b99acbea4d706e6f0:/docs/output/Ext.Function.js diff --git a/docs/output/Ext.Function.js b/docs/output/Ext.Function.js index bd712b25..5b53d274 100644 --- a/docs/output/Ext.Function.js +++ b/docs/output/Ext.Function.js @@ -1,483 +1 @@ -Ext.data.JsonP.Ext_Function({ - "allMixins": [ - - ], - "deprecated": null, - "docauthor": null, - "members": { - "cfg": [ - - ], - "method": [ - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Function.html#Ext-Function-method-alias", - "shortDoc": "Create an alias to the provided method property with name methodName of object. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js", - "private": false, - "params": [ - { - "type": "Object/Function", - "optional": false, - "doc": "\n", - "name": "object" - }, - { - "type": "String", - "optional": false, - "doc": "\n", - "name": "methodName" - } - ], - "name": "alias", - "owner": "Ext.Function", - "doc": "

Create an alias to the provided method property with name methodName of object.\nNote that the execution scope will still be bound to the provided object itself.

\n", - "linenr": 135, - "return": { - "type": "Function", - "doc": "

aliasFn

\n" - }, - "html_filename": "Function.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Function.html#Ext-Function-method-bind", - "shortDoc": "Create a new function from the provided fn, change this to the provided scope, optionally\noverrides arguments for the...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js", - "private": false, - "params": [ - { - "type": "Function", - "optional": false, - "doc": "

The function to delegate.

\n", - "name": "fn" - }, - { - "type": "Object", - "optional": true, - "doc": "

(optional) The scope (this reference) in which the function is executed.\nIf omitted, defaults to the browser window.

\n", - "name": "scope" - }, - { - "type": "Array", - "optional": true, - "doc": "

(optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)

\n", - "name": "args" - }, - { - "type": "Boolean/Number", - "optional": true, - "doc": "

(optional) if True args are appended to call args instead of overriding,\nif a number the args are inserted at the specified position

\n", - "name": "appendArgs" - } - ], - "name": "bind", - "owner": "Ext.Function", - "doc": "

Create a new function from the provided fn, change this to the provided scope, optionally\noverrides arguments for the call. (Defaults to the arguments passed by the caller)

\n\n

Ext.bind is alias for Ext.Function.bind

\n", - "linenr": 68, - "return": { - "type": "Function", - "doc": "

The new function

\n" - }, - "html_filename": "Function.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Function.html#Ext-Function-method-createBuffered", - "shortDoc": "Creates a delegate function, optionally with a bound scope which, when called, buffers\nthe execution of the passed fu...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js", - "private": false, - "params": [ - { - "type": "Function", - "optional": false, - "doc": "

The function to invoke on a buffered timer.

\n", - "name": "fn" - }, - { - "type": "Number", - "optional": false, - "doc": "

The number of milliseconds by which to buffer the invocation of the\nfunction.

\n", - "name": "buffer" - }, - { - "type": "Object", - "optional": true, - "doc": "

(optional) The scope (this reference) in which\nthe passed function is executed. If omitted, defaults to the scope specified by the caller.

\n", - "name": "scope" - }, - { - "type": "Array", - "optional": true, - "doc": "

(optional) Override arguments for the call. Defaults to the arguments\npassed by the caller.

\n", - "name": "args" - } - ], - "name": "createBuffered", - "owner": "Ext.Function", - "doc": "

Creates a delegate function, optionally with a bound scope which, when called, buffers\nthe execution of the passed function for the configured number of milliseconds.\nIf called again within that period, the impending invocation will be canceled, and the\ntimeout period will begin again.

\n", - "linenr": 292, - "return": { - "type": "Function", - "doc": "

A function which invokes the passed function after buffering for the specified time.

\n" - }, - "html_filename": "Function.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Function.html#Ext-Function-method-createDelayed", - "shortDoc": "Creates a delegate (callback) which, when called, executes after a specific delay. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js", - "private": false, - "params": [ - { - "type": "Function", - "optional": false, - "doc": "

The function which will be called on a delay when the returned function is called.\nOptionally, a replacement (or additional) argument list may be specified.

\n", - "name": "fn" - }, - { - "type": "Number", - "optional": false, - "doc": "

The number of milliseconds to defer execution by whenever called.

\n", - "name": "delay" - }, - { - "type": "Object", - "optional": true, - "doc": "

(optional) The scope (this reference) used by the function at execution time.

\n", - "name": "scope" - }, - { - "type": "Array", - "optional": true, - "doc": "

(optional) Override arguments for the call. (Defaults to the arguments passed by the caller)

\n", - "name": "args" - }, - { - "type": "Boolean/Number", - "optional": true, - "doc": "

(optional) if True args are appended to call args instead of overriding,\nif a number the args are inserted at the specified position.

\n", - "name": "appendArgs" - } - ], - "name": "createDelayed", - "owner": "Ext.Function", - "doc": "

Creates a delegate (callback) which, when called, executes after a specific delay.

\n", - "linenr": 192, - "return": { - "type": "Function", - "doc": "

A function which, when called, executes the original function after the specified delay.

\n" - }, - "html_filename": "Function.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Function.html#Ext-Function-method-createInterceptor", - "shortDoc": "Creates an interceptor function. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js", - "private": false, - "params": [ - { - "type": "Function", - "optional": false, - "doc": "

The original function.

\n", - "name": "origFn" - }, - { - "type": "Function", - "optional": false, - "doc": "

The function to call before the original

\n", - "name": "newFn" - }, - { - "type": "Object", - "optional": true, - "doc": "

(optional) The scope (this reference) in which the passed function is executed.\nIf omitted, defaults to the scope in which the original function is called or the browser window.

\n", - "name": "scope" - }, - { - "type": "Mixed", - "optional": true, - "doc": "

(optional) The value to return if the passed function return false (defaults to null).

\n", - "name": "returnValue" - } - ], - "name": "createInterceptor", - "owner": "Ext.Function", - "doc": "

Creates an interceptor function. The passed function is called before the original one. If it returns false,\nthe original one is not called. The resulting function returns the results of the original function.\nThe passed function is called with the parameters of the original function. Example usage:

\n\n
var sayHi = function(name){\n    alert('Hi, ' + name);\n}\n\nsayHi('Fred'); // alerts \"Hi, Fred\"\n\n// create a new function that validates input without\n// directly modifying the original function:\nvar sayHiToFriend = Ext.Function.createInterceptor(sayHi, function(name){\n    return name == 'Brian';\n});\n\nsayHiToFriend('Fred');  // no alert\nsayHiToFriend('Brian'); // alerts \"Hi, Brian\"\n
\n", - "linenr": 149, - "return": { - "type": "Function", - "doc": "

The new function

\n" - }, - "html_filename": "Function.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Function.html#Ext-Function-method-createSequence", - "shortDoc": "Create a combined function call sequence of the original function + the passed function. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js", - "private": false, - "params": [ - { - "type": "Function", - "optional": false, - "doc": "

The original function.

\n", - "name": "origFn" - }, - { - "type": "Function", - "optional": false, - "doc": "

The function to sequence

\n", - "name": "newFn" - }, - { - "type": "Object", - "optional": true, - "doc": "

(optional) The scope (this reference) in which the passed function is executed.\nIf omitted, defaults to the scope in which the original function is called or the browser window.

\n", - "name": "scope" - } - ], - "name": "createSequence", - "owner": "Ext.Function", - "doc": "

Create a combined function call sequence of the original function + the passed function.\nThe resulting function returns the results of the original function.\nThe passed function is called with the parameters of the original function. Example usage:

\n\n
var sayHi = function(name){\n    alert('Hi, ' + name);\n}\n\nsayHi('Fred'); // alerts \"Hi, Fred\"\n\nvar sayGoodbye = Ext.Function.createSequence(sayHi, function(name){\n    alert('Bye, ' + name);\n});\n\nsayGoodbye('Fred'); // both alerts show\n
\n", - "linenr": 256, - "return": { - "type": "Function", - "doc": "

The new function

\n" - }, - "html_filename": "Function.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Function.html#Ext-Function-method-createThrottled", - "shortDoc": "Creates a throttled version of the passed function which, when called repeatedly and\nrapidly, invokes the passed func...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js", - "private": false, - "params": [ - { - "type": "Function", - "optional": false, - "doc": "

The function to execute at a regular time interval.

\n", - "name": "fn" - }, - { - "type": "Number", - "optional": false, - "doc": "

The interval in milliseconds on which the passed function is executed.

\n", - "name": "interval" - }, - { - "type": "Object", - "optional": true, - "doc": "

(optional) The scope (this reference) in which\nthe passed function is executed. If omitted, defaults to the scope specified by the caller.

\n", - "name": "scope" - } - ], - "name": "createThrottled", - "owner": "Ext.Function", - "doc": "

Creates a throttled version of the passed function which, when called repeatedly and\nrapidly, invokes the passed function only after a certain interval has elapsed since the\nprevious invocation.

\n\n

This is useful for wrapping functions which may be called repeatedly, such as\na handler of a mouse move event when the processing is expensive.

\n", - "linenr": 323, - "return": { - "type": "Function", - "doc": "

A function which invokes the passed function at the specified interval.

\n" - }, - "html_filename": "Function.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Function.html#Ext-Function-method-defer", - "shortDoc": "Calls this function after the number of millseconds specified, optionally in a specific scope. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js", - "private": false, - "params": [ - { - "type": "Function", - "optional": false, - "doc": "

The function to defer.

\n", - "name": "fn" - }, - { - "type": "Number", - "optional": false, - "doc": "

The number of milliseconds for the setTimeout call\n(if less than or equal to 0 the function is executed immediately)

\n", - "name": "millis" - }, - { - "type": "Object", - "optional": true, - "doc": "

(optional) The scope (this reference) in which the function is executed.\nIf omitted, defaults to the browser window.

\n", - "name": "scope" - }, - { - "type": "Array", - "optional": true, - "doc": "

(optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)

\n", - "name": "args" - }, - { - "type": "Boolean/Number", - "optional": true, - "doc": "

(optional) if True args are appended to call args instead of overriding,\nif a number the args are inserted at the specified position

\n", - "name": "appendArgs" - } - ], - "name": "defer", - "owner": "Ext.Function", - "doc": "

Calls this function after the number of millseconds specified, optionally in a specific scope. Example usage:

\n\n
var sayHi = function(name){\n    alert('Hi, ' + name);\n}\n\n// executes immediately:\nsayHi('Fred');\n\n// executes after 2 seconds:\nExt.Function.defer(sayHi, 2000, this, ['Fred']);\n\n// this syntax is sometimes useful for deferring\n// execution of an anonymous function:\nExt.Function.defer(function(){\n    alert('Anonymous');\n}, 100);\n
\n\n

Ext.defer is alias for Ext.Function.defer

\n", - "linenr": 216, - "return": { - "type": "Number", - "doc": "

The timeout id that can be used with clearTimeout

\n" - }, - "html_filename": "Function.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Function.html#Ext-Function-method-flexSetter", - "shortDoc": "A very commonly used method throughout the framework. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js", - "private": false, - "params": [ - { - "type": "Function", - "optional": false, - "doc": "\n", - "name": "setter" - } - ], - "name": "flexSetter", - "owner": "Ext.Function", - "doc": "

A very commonly used method throughout the framework. It acts as a wrapper around another method\nwhich originally accepts 2 arguments for name and value.\nThe wrapped function then allows \"flexible\" value setting of either:

\n\n\n\n\n

For example:

\n\n
var setValue = Ext.Function.flexSetter(function(name, value) {\n    this[name] = value;\n});\n\n// Afterwards\n// Setting a single name - value\nsetValue('name1', 'value1');\n\n// Settings multiple name - value pairs\nsetValue({\n    name1: 'value1',\n    name2: 'value2',\n    name3: 'value3'\n});\n
\n", - "linenr": 9, - "return": { - "type": "Function", - "doc": "

flexSetter

\n" - }, - "html_filename": "Function.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Function.html#Ext-Function-method-pass", - "shortDoc": "Create a new function from the provided fn, the arguments of which are pre-set to args. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js", - "private": false, - "params": [ - { - "type": "Function", - "optional": false, - "doc": "

The original function

\n", - "name": "fn" - }, - { - "type": "Array", - "optional": false, - "doc": "

The arguments to pass to new callback

\n", - "name": "args" - }, - { - "type": "Object", - "optional": true, - "doc": "

(optional) The scope (this reference) in which the function is executed.

\n", - "name": "scope" - } - ], - "name": "pass", - "owner": "Ext.Function", - "doc": "

Create a new function from the provided fn, the arguments of which are pre-set to args.\nNew arguments passed to the newly created callback when it's invoked are appended after the pre-set ones.\nThis is especially useful when creating callbacks.

\n\n

For example:

\n\n
var originalFunction = function(){\n    alert(Ext.Array.from(arguments).join(' '));\n};\n\nvar callback = Ext.Function.pass(originalFunction, ['Hello', 'World']);\n\ncallback(); // alerts 'Hello World'\ncallback('by Me'); // alerts 'Hello World by Me'\n
\n\n

Ext.pass is alias for Ext.Function.pass

\n", - "linenr": 102, - "return": { - "type": "Function", - "doc": "

The new callback function

\n" - }, - "html_filename": "Function.html" - } - ], - "property": [ - - ], - "cssVar": [ - - ], - "cssMixin": [ - - ], - "event": [ - - ] - }, - "singleton": true, - "alias": null, - "superclasses": [ - - ], - "protected": false, - "tagname": "class", - "mixins": [ - - ], - "href": "Function.html#Ext-Function", - "subclasses": [ - - ], - "static": false, - "author": null, - "component": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js", - "private": false, - "alternateClassNames": [ - - ], - "name": "Ext.Function", - "doc": "

A collection of useful static methods to deal with function callbacks

\n", - "mixedInto": [ - - ], - "linenr": 1, - "xtypes": [ - - ], - "html_filename": "Function.html", - "extends": null -}); \ No newline at end of file +Ext.data.JsonP.Ext_Function({"tagname":"class","html":"

Files

A collection of useful static methods to deal with function callbacks

\n
Defined By

Methods

Create an alias to the provided method property with name methodName of object. ...

Create an alias to the provided method property with name methodName of object.\nNote that the execution scope will still be bound to the provided object itself.

\n

Parameters

Returns

( Function fn, [Object scope], [Array args], [Boolean/Number appendArgs] ) : Function
Create a new function from the provided fn, change this to the provided scope, optionally\noverrides arguments for the...

Create a new function from the provided fn, change this to the provided scope, optionally\noverrides arguments for the call. (Defaults to the arguments passed by the caller)

\n\n

Ext.bind is alias for Ext.Function.bind

\n

Parameters

  • fn : Function

    The function to delegate.

    \n
  • scope : Object (optional)

    The scope (this reference) in which the function is executed.\nIf omitted, defaults to the browser window.

    \n
  • args : Array (optional)

    Overrides arguments for the call. (Defaults to the arguments passed by the caller)

    \n
  • appendArgs : Boolean/Number (optional)

    if True args are appended to call args instead of overriding,\nif a number the args are inserted at the specified position

    \n

Returns

Creates a delegate function, optionally with a bound scope which, when called, buffers\nthe execution of the passed fu...

Creates a delegate function, optionally with a bound scope which, when called, buffers\nthe execution of the passed function for the configured number of milliseconds.\nIf called again within that period, the impending invocation will be canceled, and the\ntimeout period will begin again.

\n

Parameters

  • fn : Function

    The function to invoke on a buffered timer.

    \n
  • buffer : Number

    The number of milliseconds by which to buffer the invocation of the\nfunction.

    \n
  • scope : Object (optional)

    The scope (this reference) in which\nthe passed function is executed. If omitted, defaults to the scope specified by the caller.

    \n
  • args : Array (optional)

    Override arguments for the call. Defaults to the arguments\npassed by the caller.

    \n

Returns

  • Function

    A function which invokes the passed function after buffering for the specified time.

    \n
Creates a delegate (callback) which, when called, executes after a specific delay. ...

Creates a delegate (callback) which, when called, executes after a specific delay.

\n

Parameters

  • fn : Function

    The function which will be called on a delay when the returned function is called.\nOptionally, a replacement (or additional) argument list may be specified.

    \n
  • delay : Number

    The number of milliseconds to defer execution by whenever called.

    \n
  • scope : Object (optional)

    The scope (this reference) used by the function at execution time.

    \n
  • args : Array (optional)

    Override arguments for the call. (Defaults to the arguments passed by the caller)

    \n
  • appendArgs : Boolean/Number (optional)

    if True args are appended to call args instead of overriding,\nif a number the args are inserted at the specified position.

    \n

Returns

  • Function

    A function which, when called, executes the original function after the specified delay.

    \n
Creates an interceptor function. ...

Creates an interceptor function. The passed function is called before the original one. If it returns false,\nthe original one is not called. The resulting function returns the results of the original function.\nThe passed function is called with the parameters of the original function. Example usage:

\n\n
var sayHi = function(name){\n    alert('Hi, ' + name);\n}\n\nsayHi('Fred'); // alerts \"Hi, Fred\"\n\n// create a new function that validates input without\n// directly modifying the original function:\nvar sayHiToFriend = Ext.Function.createInterceptor(sayHi, function(name){\n    return name == 'Brian';\n});\n\nsayHiToFriend('Fred');  // no alert\nsayHiToFriend('Brian'); // alerts \"Hi, Brian\"\n
\n

Parameters

  • origFn : Function

    The original function.

    \n
  • newFn : Function

    The function to call before the original

    \n
  • scope : Object (optional)

    The scope (this reference) in which the passed function is executed.\nIf omitted, defaults to the scope in which the original function is called or the browser window.

    \n
  • returnValue : Object (optional)

    The value to return if the passed function return false (defaults to null).

    \n

Returns

Create a combined function call sequence of the original function + the passed function. ...

Create a combined function call sequence of the original function + the passed function.\nThe resulting function returns the results of the original function.\nThe passed function is called with the parameters of the original function. Example usage:

\n\n
var sayHi = function(name){\n    alert('Hi, ' + name);\n}\n\nsayHi('Fred'); // alerts \"Hi, Fred\"\n\nvar sayGoodbye = Ext.Function.createSequence(sayHi, function(name){\n    alert('Bye, ' + name);\n});\n\nsayGoodbye('Fred'); // both alerts show\n
\n

Parameters

  • origFn : Function

    The original function.

    \n
  • newFn : Function

    The function to sequence

    \n
  • scope : Object (optional)

    The scope (this reference) in which the passed function is executed.\nIf omitted, defaults to the scope in which the original function is called or the browser window.

    \n

Returns

Creates a throttled version of the passed function which, when called repeatedly and\nrapidly, invokes the passed func...

Creates a throttled version of the passed function which, when called repeatedly and\nrapidly, invokes the passed function only after a certain interval has elapsed since the\nprevious invocation.

\n\n

This is useful for wrapping functions which may be called repeatedly, such as\na handler of a mouse move event when the processing is expensive.

\n

Parameters

  • fn : Function

    The function to execute at a regular time interval.

    \n
  • interval : Number

    The interval in milliseconds on which the passed function is executed.

    \n
  • scope : Object (optional)

    The scope (this reference) in which\nthe passed function is executed. If omitted, defaults to the scope specified by the caller.

    \n

Returns

  • Function

    A function which invokes the passed function at the specified interval.

    \n
( Function fn, Number millis, [Object scope], [Array args], [Boolean/Number appendArgs] ) : Number
Calls this function after the number of millseconds specified, optionally in a specific scope. ...

Calls this function after the number of millseconds specified, optionally in a specific scope. Example usage:

\n\n
var sayHi = function(name){\n    alert('Hi, ' + name);\n}\n\n// executes immediately:\nsayHi('Fred');\n\n// executes after 2 seconds:\nExt.Function.defer(sayHi, 2000, this, ['Fred']);\n\n// this syntax is sometimes useful for deferring\n// execution of an anonymous function:\nExt.Function.defer(function(){\n    alert('Anonymous');\n}, 100);\n
\n\n

Ext.defer is alias for Ext.Function.defer

\n

Parameters

  • fn : Function

    The function to defer.

    \n
  • millis : Number

    The number of milliseconds for the setTimeout call\n(if less than or equal to 0 the function is executed immediately)

    \n
  • scope : Object (optional)

    The scope (this reference) in which the function is executed.\nIf omitted, defaults to the browser window.

    \n
  • args : Array (optional)

    Overrides arguments for the call. (Defaults to the arguments passed by the caller)

    \n
  • appendArgs : Boolean/Number (optional)

    if True args are appended to call args instead of overriding,\nif a number the args are inserted at the specified position

    \n

Returns

  • Number

    The timeout id that can be used with clearTimeout

    \n
A very commonly used method throughout the framework. ...

A very commonly used method throughout the framework. It acts as a wrapper around another method\nwhich originally accepts 2 arguments for name and value.\nThe wrapped function then allows \"flexible\" value setting of either:

\n\n
    \n
  • name and value as 2 arguments
  • \n
  • one single object argument with multiple key - value pairs
  • \n
\n\n\n

For example:

\n\n
var setValue = Ext.Function.flexSetter(function(name, value) {\n    this[name] = value;\n});\n\n// Afterwards\n// Setting a single name - value\nsetValue('name1', 'value1');\n\n// Settings multiple name - value pairs\nsetValue({\n    name1: 'value1',\n    name2: 'value2',\n    name3: 'value3'\n});\n
\n

Parameters

Returns

Adds behavior to an existing method that is executed after the\noriginal behavior of the function. ...

Adds behavior to an existing method that is executed after the\noriginal behavior of the function. For example:

\n\n
var soup = {\n    contents: [],\n    add: function(ingredient) {\n        this.contents.push(ingredient);\n    }\n};\nExt.Function.interceptAfter(soup, \"add\", function(ingredient){\n    // Always add a bit of extra salt\n    this.contents.push(\"salt\");\n});\nsoup.add(\"water\");\nsoup.add(\"onions\");\nsoup.contents; // will contain: water, salt, onions, salt\n
\n

Parameters

  • object : Object

    The target object

    \n
  • methodName : String

    Name of the method to override

    \n
  • fn : Function

    Function with the new behavior. It will\nbe called with the same arguments as the original method. The\nreturn value of this function will be the return value of the\nnew method.

    \n

Returns

  • Function

    The new function just created.

    \n
Adds behavior to an existing method that is executed before the\noriginal behavior of the function. ...

Adds behavior to an existing method that is executed before the\noriginal behavior of the function. For example:

\n\n
var soup = {\n    contents: [],\n    add: function(ingredient) {\n        this.contents.push(ingredient);\n    }\n};\nExt.Function.interceptBefore(soup, \"add\", function(ingredient){\n    if (!this.contents.length && ingredient !== \"water\") {\n        // Always add water to start with\n        this.contents.push(\"water\");\n    }\n});\nsoup.add(\"onions\");\nsoup.add(\"salt\");\nsoup.contents; // will contain: water, onions, salt\n
\n

Parameters

  • object : Object

    The target object

    \n
  • methodName : String

    Name of the method to override

    \n
  • fn : Function

    Function with the new behavior. It will\nbe called with the same arguments as the original method. The\nreturn value of this function will be the return value of the\nnew method.

    \n

Returns

  • Function

    The new function just created.

    \n
Create a new function from the provided fn, the arguments of which are pre-set to args. ...

Create a new function from the provided fn, the arguments of which are pre-set to args.\nNew arguments passed to the newly created callback when it's invoked are appended after the pre-set ones.\nThis is especially useful when creating callbacks.

\n\n

For example:

\n\n
var originalFunction = function(){\n    alert(Ext.Array.from(arguments).join(' '));\n};\n\nvar callback = Ext.Function.pass(originalFunction, ['Hello', 'World']);\n\ncallback(); // alerts 'Hello World'\ncallback('by Me'); // alerts 'Hello World by Me'\n
\n\n

Ext.pass is alias for Ext.Function.pass

\n

Parameters

  • fn : Function

    The original function

    \n
  • args : Array

    The arguments to pass to new callback

    \n
  • scope : Object (optional)

    The scope (this reference) in which the function is executed.

    \n

Returns

","allMixins":[],"meta":{},"requires":[],"deprecated":null,"extends":null,"inheritable":false,"static":false,"superclasses":[],"singleton":true,"code_type":"assignment","alias":null,"statics":{"property":[],"css_var":[],"css_mixin":[],"cfg":[],"method":[],"event":[]},"subclasses":[],"uses":[],"protected":false,"mixins":[],"members":{"property":[],"css_var":[],"css_mixin":[],"cfg":[],"method":[{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Function","template":false,"required":null,"protected":false,"name":"alias","id":"method-alias"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Function","template":false,"required":null,"protected":false,"name":"bind","id":"method-bind"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Function","template":false,"required":null,"protected":false,"name":"createBuffered","id":"method-createBuffered"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Function","template":false,"required":null,"protected":false,"name":"createDelayed","id":"method-createDelayed"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Function","template":false,"required":null,"protected":false,"name":"createInterceptor","id":"method-createInterceptor"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Function","template":false,"required":null,"protected":false,"name":"createSequence","id":"method-createSequence"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Function","template":false,"required":null,"protected":false,"name":"createThrottled","id":"method-createThrottled"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Function","template":false,"required":null,"protected":false,"name":"defer","id":"method-defer"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Function","template":false,"required":null,"protected":false,"name":"flexSetter","id":"method-flexSetter"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Function","template":false,"required":null,"protected":false,"name":"interceptAfter","id":"method-interceptAfter"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Function","template":false,"required":null,"protected":false,"name":"interceptBefore","id":"method-interceptBefore"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Function","template":false,"required":null,"protected":false,"name":"pass","id":"method-pass"}],"event":[]},"private":false,"component":false,"name":"Ext.Function","alternateClassNames":[],"id":"class-Ext.Function","mixedInto":[],"xtypes":{},"files":[{"href":"Function2.html#Ext-Function","filename":"Function.js"}]}); \ No newline at end of file