Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / docs / output / Ext.Function.js
1 Ext.data.JsonP.Ext_Function({
2   "allMixins": [
3
4   ],
5   "deprecated": null,
6   "docauthor": null,
7   "members": {
8     "cfg": [
9
10     ],
11     "method": [
12       {
13         "deprecated": null,
14         "alias": null,
15         "protected": false,
16         "tagname": "method",
17         "href": "Function.html#Ext-Function-method-alias",
18         "shortDoc": "Create an alias to the provided method property with name methodName of object. ...",
19         "static": false,
20         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js",
21         "private": false,
22         "params": [
23           {
24             "type": "Object/Function",
25             "optional": false,
26             "doc": "\n",
27             "name": "object"
28           },
29           {
30             "type": "String",
31             "optional": false,
32             "doc": "\n",
33             "name": "methodName"
34           }
35         ],
36         "name": "alias",
37         "owner": "Ext.Function",
38         "doc": "<p>Create an alias to the provided method property with name <code>methodName</code> of <code>object</code>.\nNote that the execution scope will still be bound to the provided <code>object</code> itself.</p>\n",
39         "linenr": 135,
40         "return": {
41           "type": "Function",
42           "doc": "<p>aliasFn</p>\n"
43         },
44         "html_filename": "Function.html"
45       },
46       {
47         "deprecated": null,
48         "alias": null,
49         "protected": false,
50         "tagname": "method",
51         "href": "Function.html#Ext-Function-method-bind",
52         "shortDoc": "Create a new function from the provided fn, change this to the provided scope, optionally\noverrides arguments for the...",
53         "static": false,
54         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js",
55         "private": false,
56         "params": [
57           {
58             "type": "Function",
59             "optional": false,
60             "doc": "<p>The function to delegate.</p>\n",
61             "name": "fn"
62           },
63           {
64             "type": "Object",
65             "optional": true,
66             "doc": "<p>(optional) The scope (<code>this</code> reference) in which the function is executed.\n<strong>If omitted, defaults to the browser window.</strong></p>\n",
67             "name": "scope"
68           },
69           {
70             "type": "Array",
71             "optional": true,
72             "doc": "<p>(optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)</p>\n",
73             "name": "args"
74           },
75           {
76             "type": "Boolean/Number",
77             "optional": true,
78             "doc": "<p>(optional) if True args are appended to call args instead of overriding,\nif a number the args are inserted at the specified position</p>\n",
79             "name": "appendArgs"
80           }
81         ],
82         "name": "bind",
83         "owner": "Ext.Function",
84         "doc": "<p>Create a new function from the provided <code>fn</code>, change <code>this</code> to the provided scope, optionally\noverrides arguments for the call. (Defaults to the arguments passed by the caller)</p>\n\n<p><a href=\"#/api/Ext-method-bind\" rel=\"Ext-method-bind\" class=\"docClass\">Ext.bind</a> is alias for <a href=\"#/api/Ext.Function-method-bind\" rel=\"Ext.Function-method-bind\" class=\"docClass\">Ext.Function.bind</a></p>\n",
85         "linenr": 68,
86         "return": {
87           "type": "Function",
88           "doc": "<p>The new function</p>\n"
89         },
90         "html_filename": "Function.html"
91       },
92       {
93         "deprecated": null,
94         "alias": null,
95         "protected": false,
96         "tagname": "method",
97         "href": "Function.html#Ext-Function-method-createBuffered",
98         "shortDoc": "Creates a delegate function, optionally with a bound scope which, when called, buffers\nthe execution of the passed fu...",
99         "static": false,
100         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js",
101         "private": false,
102         "params": [
103           {
104             "type": "Function",
105             "optional": false,
106             "doc": "<p>The function to invoke on a buffered timer.</p>\n",
107             "name": "fn"
108           },
109           {
110             "type": "Number",
111             "optional": false,
112             "doc": "<p>The number of milliseconds by which to buffer the invocation of the\nfunction.</p>\n",
113             "name": "buffer"
114           },
115           {
116             "type": "Object",
117             "optional": true,
118             "doc": "<p>(optional) The scope (<code>this</code> reference) in which\nthe passed function is executed. If omitted, defaults to the scope specified by the caller.</p>\n",
119             "name": "scope"
120           },
121           {
122             "type": "Array",
123             "optional": true,
124             "doc": "<p>(optional) Override arguments for the call. Defaults to the arguments\npassed by the caller.</p>\n",
125             "name": "args"
126           }
127         ],
128         "name": "createBuffered",
129         "owner": "Ext.Function",
130         "doc": "<p>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.</p>\n",
131         "linenr": 292,
132         "return": {
133           "type": "Function",
134           "doc": "<p>A function which invokes the passed function after buffering for the specified time.</p>\n"
135         },
136         "html_filename": "Function.html"
137       },
138       {
139         "deprecated": null,
140         "alias": null,
141         "protected": false,
142         "tagname": "method",
143         "href": "Function.html#Ext-Function-method-createDelayed",
144         "shortDoc": "Creates a delegate (callback) which, when called, executes after a specific delay. ...",
145         "static": false,
146         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js",
147         "private": false,
148         "params": [
149           {
150             "type": "Function",
151             "optional": false,
152             "doc": "<p>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.</p>\n",
153             "name": "fn"
154           },
155           {
156             "type": "Number",
157             "optional": false,
158             "doc": "<p>The number of milliseconds to defer execution by whenever called.</p>\n",
159             "name": "delay"
160           },
161           {
162             "type": "Object",
163             "optional": true,
164             "doc": "<p>(optional) The scope (<code>this</code> reference) used by the function at execution time.</p>\n",
165             "name": "scope"
166           },
167           {
168             "type": "Array",
169             "optional": true,
170             "doc": "<p>(optional) Override arguments for the call. (Defaults to the arguments passed by the caller)</p>\n",
171             "name": "args"
172           },
173           {
174             "type": "Boolean/Number",
175             "optional": true,
176             "doc": "<p>(optional) if True args are appended to call args instead of overriding,\nif a number the args are inserted at the specified position.</p>\n",
177             "name": "appendArgs"
178           }
179         ],
180         "name": "createDelayed",
181         "owner": "Ext.Function",
182         "doc": "<p>Creates a delegate (callback) which, when called, executes after a specific delay.</p>\n",
183         "linenr": 192,
184         "return": {
185           "type": "Function",
186           "doc": "<p>A function which, when called, executes the original function after the specified delay.</p>\n"
187         },
188         "html_filename": "Function.html"
189       },
190       {
191         "deprecated": null,
192         "alias": null,
193         "protected": false,
194         "tagname": "method",
195         "href": "Function.html#Ext-Function-method-createInterceptor",
196         "shortDoc": "Creates an interceptor function. ...",
197         "static": false,
198         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js",
199         "private": false,
200         "params": [
201           {
202             "type": "Function",
203             "optional": false,
204             "doc": "<p>The original function.</p>\n",
205             "name": "origFn"
206           },
207           {
208             "type": "Function",
209             "optional": false,
210             "doc": "<p>The function to call before the original</p>\n",
211             "name": "newFn"
212           },
213           {
214             "type": "Object",
215             "optional": true,
216             "doc": "<p>(optional) The scope (<code>this</code> reference) in which the passed function is executed.\n<strong>If omitted, defaults to the scope in which the original function is called or the browser window.</strong></p>\n",
217             "name": "scope"
218           },
219           {
220             "type": "Mixed",
221             "optional": true,
222             "doc": "<p>(optional) The value to return if the passed function return false (defaults to null).</p>\n",
223             "name": "returnValue"
224           }
225         ],
226         "name": "createInterceptor",
227         "owner": "Ext.Function",
228         "doc": "<p>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:</p>\n\n<pre><code>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</code></pre>\n",
229         "linenr": 149,
230         "return": {
231           "type": "Function",
232           "doc": "<p>The new function</p>\n"
233         },
234         "html_filename": "Function.html"
235       },
236       {
237         "deprecated": null,
238         "alias": null,
239         "protected": false,
240         "tagname": "method",
241         "href": "Function.html#Ext-Function-method-createSequence",
242         "shortDoc": "Create a combined function call sequence of the original function + the passed function. ...",
243         "static": false,
244         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js",
245         "private": false,
246         "params": [
247           {
248             "type": "Function",
249             "optional": false,
250             "doc": "<p>The original function.</p>\n",
251             "name": "origFn"
252           },
253           {
254             "type": "Function",
255             "optional": false,
256             "doc": "<p>The function to sequence</p>\n",
257             "name": "newFn"
258           },
259           {
260             "type": "Object",
261             "optional": true,
262             "doc": "<p>(optional) The scope (<code>this</code> 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.</p>\n",
263             "name": "scope"
264           }
265         ],
266         "name": "createSequence",
267         "owner": "Ext.Function",
268         "doc": "<p>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:</p>\n\n<pre><code>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</code></pre>\n",
269         "linenr": 256,
270         "return": {
271           "type": "Function",
272           "doc": "<p>The new function</p>\n"
273         },
274         "html_filename": "Function.html"
275       },
276       {
277         "deprecated": null,
278         "alias": null,
279         "protected": false,
280         "tagname": "method",
281         "href": "Function.html#Ext-Function-method-createThrottled",
282         "shortDoc": "Creates a throttled version of the passed function which, when called repeatedly and\nrapidly, invokes the passed func...",
283         "static": false,
284         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js",
285         "private": false,
286         "params": [
287           {
288             "type": "Function",
289             "optional": false,
290             "doc": "<p>The function to execute at a regular time interval.</p>\n",
291             "name": "fn"
292           },
293           {
294             "type": "Number",
295             "optional": false,
296             "doc": "<p>The interval <strong>in milliseconds</strong> on which the passed function is executed.</p>\n",
297             "name": "interval"
298           },
299           {
300             "type": "Object",
301             "optional": true,
302             "doc": "<p>(optional) The scope (<code>this</code> reference) in which\nthe passed function is executed. If omitted, defaults to the scope specified by the caller.</p>\n",
303             "name": "scope"
304           }
305         ],
306         "name": "createThrottled",
307         "owner": "Ext.Function",
308         "doc": "<p>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.</p>\n\n<p>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.</p>\n",
309         "linenr": 323,
310         "return": {
311           "type": "Function",
312           "doc": "<p>A function which invokes the passed function at the specified interval.</p>\n"
313         },
314         "html_filename": "Function.html"
315       },
316       {
317         "deprecated": null,
318         "alias": null,
319         "protected": false,
320         "tagname": "method",
321         "href": "Function.html#Ext-Function-method-defer",
322         "shortDoc": "Calls this function after the number of millseconds specified, optionally in a specific scope. ...",
323         "static": false,
324         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js",
325         "private": false,
326         "params": [
327           {
328             "type": "Function",
329             "optional": false,
330             "doc": "<p>The function to defer.</p>\n",
331             "name": "fn"
332           },
333           {
334             "type": "Number",
335             "optional": false,
336             "doc": "<p>The number of milliseconds for the setTimeout call\n(if less than or equal to 0 the function is executed immediately)</p>\n",
337             "name": "millis"
338           },
339           {
340             "type": "Object",
341             "optional": true,
342             "doc": "<p>(optional) The scope (<code>this</code> reference) in which the function is executed.\n<strong>If omitted, defaults to the browser window.</strong></p>\n",
343             "name": "scope"
344           },
345           {
346             "type": "Array",
347             "optional": true,
348             "doc": "<p>(optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)</p>\n",
349             "name": "args"
350           },
351           {
352             "type": "Boolean/Number",
353             "optional": true,
354             "doc": "<p>(optional) if True args are appended to call args instead of overriding,\nif a number the args are inserted at the specified position</p>\n",
355             "name": "appendArgs"
356           }
357         ],
358         "name": "defer",
359         "owner": "Ext.Function",
360         "doc": "<p>Calls this function after the number of millseconds specified, optionally in a specific scope. Example usage:</p>\n\n<pre><code>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</code></pre>\n\n<p><a href=\"#/api/Ext-method-defer\" rel=\"Ext-method-defer\" class=\"docClass\">Ext.defer</a> is alias for <a href=\"#/api/Ext.Function-method-defer\" rel=\"Ext.Function-method-defer\" class=\"docClass\">Ext.Function.defer</a></p>\n",
361         "linenr": 216,
362         "return": {
363           "type": "Number",
364           "doc": "<p>The timeout id that can be used with clearTimeout</p>\n"
365         },
366         "html_filename": "Function.html"
367       },
368       {
369         "deprecated": null,
370         "alias": null,
371         "protected": false,
372         "tagname": "method",
373         "href": "Function.html#Ext-Function-method-flexSetter",
374         "shortDoc": "A very commonly used method throughout the framework. ...",
375         "static": false,
376         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js",
377         "private": false,
378         "params": [
379           {
380             "type": "Function",
381             "optional": false,
382             "doc": "\n",
383             "name": "setter"
384           }
385         ],
386         "name": "flexSetter",
387         "owner": "Ext.Function",
388         "doc": "<p>A very commonly used method throughout the framework. It acts as a wrapper around another method\nwhich originally accepts 2 arguments for <code>name</code> and <code>value</code>.\nThe wrapped function then allows \"flexible\" value setting of either:</p>\n\n<ul>\n<li><code>name</code> and <code>value</code> as 2 arguments</li>\n<li>one single object argument with multiple key - value pairs</li>\n</ul>\n\n\n<p>For example:</p>\n\n<pre><code>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</code></pre>\n",
389         "linenr": 9,
390         "return": {
391           "type": "Function",
392           "doc": "<p>flexSetter</p>\n"
393         },
394         "html_filename": "Function.html"
395       },
396       {
397         "deprecated": null,
398         "alias": null,
399         "protected": false,
400         "tagname": "method",
401         "href": "Function.html#Ext-Function-method-pass",
402         "shortDoc": "Create a new function from the provided fn, the arguments of which are pre-set to args. ...",
403         "static": false,
404         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js",
405         "private": false,
406         "params": [
407           {
408             "type": "Function",
409             "optional": false,
410             "doc": "<p>The original function</p>\n",
411             "name": "fn"
412           },
413           {
414             "type": "Array",
415             "optional": false,
416             "doc": "<p>The arguments to pass to new callback</p>\n",
417             "name": "args"
418           },
419           {
420             "type": "Object",
421             "optional": true,
422             "doc": "<p>(optional) The scope (<code>this</code> reference) in which the function is executed.</p>\n",
423             "name": "scope"
424           }
425         ],
426         "name": "pass",
427         "owner": "Ext.Function",
428         "doc": "<p>Create a new function from the provided <code>fn</code>, the arguments of which are pre-set to <code>args</code>.\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.</p>\n\n<p>For example:</p>\n\n<pre><code>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</code></pre>\n\n<p><a href=\"#/api/Ext-method-pass\" rel=\"Ext-method-pass\" class=\"docClass\">Ext.pass</a> is alias for <a href=\"#/api/Ext.Function-method-pass\" rel=\"Ext.Function-method-pass\" class=\"docClass\">Ext.Function.pass</a></p>\n",
429         "linenr": 102,
430         "return": {
431           "type": "Function",
432           "doc": "<p>The new callback function</p>\n"
433         },
434         "html_filename": "Function.html"
435       }
436     ],
437     "property": [
438
439     ],
440     "cssVar": [
441
442     ],
443     "cssMixin": [
444
445     ],
446     "event": [
447
448     ]
449   },
450   "singleton": true,
451   "alias": null,
452   "superclasses": [
453
454   ],
455   "protected": false,
456   "tagname": "class",
457   "mixins": [
458
459   ],
460   "href": "Function.html#Ext-Function",
461   "subclasses": [
462
463   ],
464   "static": false,
465   "author": null,
466   "component": false,
467   "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Function.js",
468   "private": false,
469   "alternateClassNames": [
470
471   ],
472   "name": "Ext.Function",
473   "doc": "<p>A collection of useful static methods to deal with function callbacks</p>\n",
474   "mixedInto": [
475
476   ],
477   "linenr": 1,
478   "xtypes": [
479
480   ],
481   "html_filename": "Function.html",
482   "extends": null
483 });