4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext'>/**
21 The Ext namespace (global object) encapsulates all classes, singletons, and utility methods provided by Sencha's libraries.</p>
22 Most user interface Components are at a lower level of nesting in the namespace, but many common utility functions are provided
23 as direct properties of the Ext namespace.
25 Also many frequently used methods from other classes are provided as shortcuts within the Ext namespace.
26 For example {@link Ext#getCmp Ext.getCmp} aliases {@link Ext.ComponentManager#get Ext.ComponentManager.get}.
28 Many applications are initiated with {@link Ext#onReady Ext.onReady} which is called once the DOM is ready.
29 This ensures all scripts have been loaded, preventing dependency issues. For example
31 Ext.onReady(function(){
33 renderTo: document.body,
38 For more information about how to use the Ext classes, see
40 - <a href="http://www.sencha.com/learn/">The Learning Center</a>
41 - <a href="http://www.sencha.com/learn/Ext_FAQ">The FAQ</a>
42 - <a href="http://www.sencha.com/forum/">The forums</a>
48 userAgent: navigator.userAgent.toLowerCase(),
51 BLANK_IMAGE_URL : 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
52 isStrict: document.compatMode == "CSS1Compat",
53 windowId: 'ext-window',
54 documentId: 'ext-document',
56 <span id='Ext-property-isReady'> /**
57 </span> * True when the document is fully initialized and ready for action
62 <span id='Ext-property-enableGarbageCollector'> /**
63 </span> * True to automatically uncache orphaned Ext.core.Elements periodically (defaults to true)
66 enableGarbageCollector: true,
68 <span id='Ext-property-enableListenerCollection'> /**
69 </span> * True to automatically purge event listeners during garbageCollection (defaults to true).
72 enableListenerCollection: true,
74 <span id='Ext-method-id'> /**
75 </span> * Generates unique ids. If the element already has an id, it is unchanged
76 * @param {Mixed} el (optional) The element to generate an id for
77 * @param {String} prefix (optional) Id prefix (defaults "ext-gen")
78 * @return {String} The generated Id.
80 id: function(el, prefix) {
81 el = Ext.getDom(el, true) || {};
82 if (el === document) {
83 el.id = this.documentId;
85 else if (el === window) {
86 el.id = this.windowId;
89 el.id = (prefix || "ext-gen") + (++Ext.idSeed);
94 <span id='Ext-method-getBody'> /**
95 </span> * Returns the current document body as an {@link Ext.core.Element}.
96 * @return Ext.core.Element The document body
99 return Ext.get(document.body || false);
102 <span id='Ext-method-getHead'> /**
103 </span> * Returns the current document head as an {@link Ext.core.Element}.
104 * @return Ext.core.Element The document head
107 getHead: function() {
111 if (head == undefined) {
112 head = Ext.get(document.getElementsByTagName("head")[0]);
119 <span id='Ext-method-getDoc'> /**
120 </span> * Returns the current HTML document object as an {@link Ext.core.Element}.
121 * @return Ext.core.Element The document
124 return Ext.get(document);
127 <span id='Ext-method-getCmp'> /**
128 </span> * This is shorthand reference to {@link Ext.ComponentManager#get}.
129 * Looks up an existing {@link Ext.Component Component} by {@link Ext.Component#id id}
130 * @param {String} id The component {@link Ext.Component#id id}
131 * @return Ext.Component The Component, <tt>undefined</tt> if not found, or <tt>null</tt> if a
134 getCmp: function(id) {
135 return Ext.ComponentManager.get(id);
138 <span id='Ext-method-getOrientation'> /**
139 </span> * Returns the current orientation of the mobile device
140 * @return {String} Either 'portrait' or 'landscape'
142 getOrientation: function() {
143 return window.innerHeight > window.innerWidth ? 'portrait' : 'landscape';
146 <span id='Ext-method-destroy'> /**
147 </span> * Attempts to destroy any objects passed to it by removing all event listeners, removing them from the
148 * DOM (if applicable) and calling their destroy functions (if available). This method is primarily
149 * intended for arguments of type {@link Ext.core.Element} and {@link Ext.Component}, but any subclass of
150 * {@link Ext.util.Observable} can be passed in. Any number of elements and/or components can be
151 * passed into this function in a single call as separate arguments.
152 * @param {Mixed} arg1 An {@link Ext.core.Element}, {@link Ext.Component}, or an Array of either of these to destroy
153 * @param {Mixed} arg2 (optional)
154 * @param {Mixed} etc... (optional)
156 destroy: function() {
157 var ln = arguments.length,
160 for (i = 0; i < ln; i++) {
163 if (Ext.isArray(arg)) {
164 this.destroy.apply(this, arg);
166 else if (Ext.isFunction(arg.destroy)) {
176 <span id='Ext-method-callback'> /**
177 </span> * Execute a callback function in a particular scope. If no function is passed the call is ignored.
178 * @param {Function} callback The callback to execute
179 * @param {Object} scope (optional) The scope to execute in
180 * @param {Array} args (optional) The arguments to pass to the function
181 * @param {Number} delay (optional) Pass a number to delay the call by a number of milliseconds.
183 callback: function(callback, scope, args, delay){
184 if(Ext.isFunction(callback)){
186 scope = scope || window;
188 Ext.defer(callback, delay, scope, args);
190 callback.apply(scope, args);
195 <span id='Ext-method-htmlEncode'> /**
196 </span> * Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pages.
197 * @param {String} value The string to encode
198 * @return {String} The encoded text
200 htmlEncode : function(value) {
201 return Ext.String.htmlEncode(value);
204 <span id='Ext-method-htmlDecode'> /**
205 </span> * Convert certain characters (&, <, >, and ') from their HTML character equivalents.
206 * @param {String} value The string to decode
207 * @return {String} The decoded text
209 htmlDecode : function(value) {
210 return Ext.String.htmlDecode(value);
213 <span id='Ext-method-urlAppend'> /**
214 </span> * Appends content to the query string of a URL, handling logic for whether to place
215 * a question mark or ampersand.
216 * @param {String} url The URL to append to.
217 * @param {String} s The content to append to the URL.
218 * @return (String) The resulting URL
220 urlAppend : function(url, s) {
221 if (!Ext.isEmpty(s)) {
222 return url + (url.indexOf('?') === -1 ? '?' : '&') + s;
229 Ext.ns = Ext.namespace;
232 window.undefined = window.undefined;
236 * Ext core utilities and functions.
240 var check = function(regex){
241 return regex.test(Ext.userAgent);
243 docMode = document.documentMode,
244 isOpera = check(/opera/),
245 isOpera10_5 = isOpera && check(/version\/10\.5/),
246 isChrome = check(/\bchrome\b/),
247 isWebKit = check(/webkit/),
248 isSafari = !isChrome && check(/safari/),
249 isSafari2 = isSafari && check(/applewebkit\/4/), // unique to Safari 2
250 isSafari3 = isSafari && check(/version\/3/),
251 isSafari4 = isSafari && check(/version\/4/),
252 isIE = !isOpera && check(/msie/),
253 isIE7 = isIE && (check(/msie 7/) || docMode == 7),
254 isIE8 = isIE && (check(/msie 8/) && docMode != 7 && docMode != 9 || docMode == 8),
255 isIE9 = isIE && (check(/msie 9/) && docMode != 7 && docMode != 8 || docMode == 9),
256 isIE6 = isIE && check(/msie 6/),
257 isGecko = !isWebKit && check(/gecko/),
258 isGecko3 = isGecko && check(/rv:1\.9/),
259 isGecko4 = isGecko && check(/rv:2\.0/),
260 isFF3_0 = isGecko3 && check(/rv:1\.9\.0/),
261 isFF3_5 = isGecko3 && check(/rv:1\.9\.1/),
262 isFF3_6 = isGecko3 && check(/rv:1\.9\.2/),
263 isWindows = check(/windows|win32/),
264 isMac = check(/macintosh|mac os x/),
265 isLinux = check(/linux/),
267 webKitVersion = isWebKit && (/webkit\/(\d+\.\d+)/.exec(Ext.userAgent));
269 // remove css image flicker
271 document.execCommand("BackgroundImageCache", false, true);
274 Ext.setVersion('extjs', '4.0.0');
276 <span id='Ext-property-SSL_SECURE_URL'> /**
277 </span> * URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent
278 * the IE insecure content warning (<tt>'about:blank'</tt>, except for IE in secure mode, which is <tt>'javascript:""'</tt>).
281 SSL_SECURE_URL : Ext.isSecure && isIE ? 'javascript:""' : 'about:blank',
283 <span id='Ext-property-enableFx'> /**
284 </span> * True if the {@link Ext.fx.Anim} Class is available
289 <span id='Ext-property-scopeResetCSS'> /**
290 </span> * True to scope the reset CSS to be just applied to Ext components. Note that this wraps root containers
291 * with an additional element. Also remember that when you turn on this option, you have to use ext-all-scoped {
292 * unless you use the bootstrap.js to load your javascript, in which case it will be handled for you.
295 scopeResetCSS : Ext.buildSettings.scopeResetCSS,
297 <span id='Ext-property-enableNestedListenerRemoval'> /**
298 </span> * EXPERIMENTAL - True to cascade listener removal to child elements when an element is removed.
299 * Currently not optimized for performance.
302 enableNestedListenerRemoval : false,
304 <span id='Ext-property-USE_NATIVE_JSON'> /**
305 </span> * Indicates whether to use native browser parsing for JSON methods.
306 * This option is ignored if the browser does not support native JSON methods.
307 * <b>Note: Native JSON methods will not work with objects that have functions.
308 * Also, property names must be quoted, otherwise the data will not parse.</b> (Defaults to false)
311 USE_NATIVE_JSON : false,
313 <span id='Ext-method-getDom'> /**
314 </span> * Return the dom node for the passed String (id), dom node, or Ext.core.Element.
315 * Optional 'strict' flag is needed for IE since it can return 'name' and
316 * 'id' elements by using getElementById.
317 * Here are some examples:
318 * <pre><code>
319 // gets dom node based on id
320 var elDom = Ext.getDom('elId');
321 // gets dom node based on the dom node
322 var elDom1 = Ext.getDom(elDom);
324 // If we don&#39;t know if we are working with an
325 // Ext.core.Element or a dom node use Ext.getDom
327 var dom = Ext.getDom(el);
328 // do something with the dom node
330 * </code></pre>
331 * <b>Note</b>: the dom node to be found actually needs to exist (be rendered, etc)
332 * when this method is called to be successful.
334 * @return HTMLElement
336 getDom : function(el, strict) {
337 if (!el || !document) {
343 if (typeof el == 'string') {
344 var e = document.getElementById(el);
345 // IE returns elements with the 'name' and 'id' attribute.
346 // we do a strict check to return the element with only the id attribute
347 if (e && isIE && strict) {
348 if (el == e.getAttribute('id')) {
361 <span id='Ext-method-removeNode'> /**
362 </span> * Removes a DOM node from the document.
363 * <p>Removes this element from the document, removes all DOM event listeners, and deletes the cache reference.
364 * All DOM event listeners are removed from this element. If {@link Ext#enableNestedListenerRemoval Ext.enableNestedListenerRemoval} is
365 * <code>true</code>, then DOM event listeners are also removed from all child nodes. The body node
366 * will be ignored if passed in.</p>
367 * @param {HTMLElement} node The node to remove
370 removeNode : isIE6 || isIE7 ? function() {
373 if(n && n.tagName != 'BODY'){
374 (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n) : Ext.EventManager.removeAll(n);
375 d = d || document.createElement('div');
378 delete Ext.cache[n.id];
382 if (n && n.parentNode && n.tagName != 'BODY') {
383 (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n) : Ext.EventManager.removeAll(n);
384 n.parentNode.removeChild(n);
385 delete Ext.cache[n.id];
389 <span id='Ext-property-isOpera'> /**
390 </span> * True if the detected browser is Opera.
395 <span id='Ext-property-isOpera10_5'> /**
396 </span> * True if the detected browser is Opera 10.5x.
399 isOpera10_5 : isOpera10_5,
401 <span id='Ext-property-isWebKit'> /**
402 </span> * True if the detected browser uses WebKit.
407 <span id='Ext-property-isChrome'> /**
408 </span> * True if the detected browser is Chrome.
413 <span id='Ext-property-isSafari'> /**
414 </span> * True if the detected browser is Safari.
419 <span id='Ext-property-isSafari3'> /**
420 </span> * True if the detected browser is Safari 3.x.
423 isSafari3 : isSafari3,
425 <span id='Ext-property-isSafari4'> /**
426 </span> * True if the detected browser is Safari 4.x.
429 isSafari4 : isSafari4,
431 <span id='Ext-property-isSafari2'> /**
432 </span> * True if the detected browser is Safari 2.x.
435 isSafari2 : isSafari2,
437 <span id='Ext-property-isIE'> /**
438 </span> * True if the detected browser is Internet Explorer.
443 <span id='Ext-property-isIE6'> /**
444 </span> * True if the detected browser is Internet Explorer 6.x.
449 <span id='Ext-property-isIE7'> /**
450 </span> * True if the detected browser is Internet Explorer 7.x.
455 <span id='Ext-property-isIE8'> /**
456 </span> * True if the detected browser is Internet Explorer 8.x.
461 <span id='Ext-property-isIE9'> /**
462 </span> * True if the detected browser is Internet Explorer 9.x.
467 <span id='Ext-property-isGecko'> /**
468 </span> * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
473 <span id='Ext-property-isGecko3'> /**
474 </span> * True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x).
479 <span id='Ext-property-isGecko4'> /**
480 </span> * True if the detected browser uses a Gecko 2.0+ layout engine (e.g. Firefox 4.x).
485 <span id='Ext-property-isFF3_0'> /**
486 </span> * True if the detected browser uses FireFox 3.0
491 <span id='Ext-property-isFF3_5'> /**
492 </span> * True if the detected browser uses FireFox 3.5
497 <span id='Ext-property-isFF3_6'> /**
498 </span> * True if the detected browser uses FireFox 3.6
503 <span id='Ext-property-isLinux'> /**
504 </span> * True if the detected platform is Linux.
509 <span id='Ext-property-isWindows'> /**
510 </span> * True if the detected platform is Windows.
513 isWindows : isWindows,
515 <span id='Ext-property-isMac'> /**
516 </span> * True if the detected platform is Mac OS.
521 <span id='Ext-property-webKitVersion'> /**
522 </span> * The current version of WebKit (-1 if the browser does not use WebKit).
525 webKitVersion: webKitVersion ? parseFloat(webKitVersion[1]) : -1,
527 <span id='Ext-property-BLANK_IMAGE_URL'> /**
528 </span> * URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images.
529 * In older versions of IE, this defaults to "http://sencha.com/s.gif" and you should change this to a URL on your server.
530 * For other browsers it uses an inline data URL.
533 BLANK_IMAGE_URL : (isIE6 || isIE7) ? 'http:/' + '/www.sencha.com/s.gif' : 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
535 <span id='Ext-method-value'> /**
536 </span> * <p>Utility method for returning a default value if the passed value is empty.</p>
537 * <p>The value is deemed to be empty if it is<div class="mdetail-params"><ul>
538 * <li>null</li>
539 * <li>undefined</li>
540 * <li>an empty array</li>
541 * <li>a zero length string (Unless the <tt>allowBlank</tt> parameter is <tt>true</tt>)</li>
542 * </ul></div>
543 * @param {Mixed} value The value to test
544 * @param {Mixed} defaultValue The value to return if the original value is empty
545 * @param {Boolean} allowBlank (optional) true to allow zero length strings to qualify as non-empty (defaults to false)
546 * @return {Mixed} value, if non-empty, else defaultValue
547 * @deprecated 4.0.0 Use {Ext#valueFrom} instead
549 value : function(v, defaultValue, allowBlank){
550 return Ext.isEmpty(v, allowBlank) ? defaultValue : v;
553 <span id='Ext-method-escapeRe'> /**
554 </span> * Escapes the passed string for use in a regular expression
555 * @param {String} str
557 * @deprecated 4.0.0 Use {@link Ext.String#escapeRegex} instead
559 escapeRe : function(s) {
560 return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1");
563 <span id='Ext-method-addBehaviors'> /**
564 </span> * Applies event listeners to elements by selectors when the document is ready.
565 * The event name is specified with an <tt>&#64;</tt> suffix.
566 * <pre><code>
568 // add a listener for click on all anchors in element with id foo
569 '#foo a&#64;click' : function(e, t){
573 // add the same listener to multiple selectors (separated by comma BEFORE the &#64;)
574 '#foo a, #bar span.some-class&#64;mouseover' : function(){
578 * </code></pre>
579 * @param {Object} obj The list of behaviors to apply
581 addBehaviors : function(o){
583 Ext.onReady(function(){
587 var cache = {}, // simple cache for applying multiple behaviors to same selector does query multiple times
592 if ((parts = b.split('@'))[1]) { // for Object prototype breakers
595 cache[s] = Ext.select(s);
597 cache[s].on(parts[1], o[b]);
604 <span id='Ext-method-getScrollBarWidth'> /**
605 </span> * Utility method for getting the width of the browser scrollbar. This can differ depending on
606 * operating system settings, such as the theme or font size.
607 * @param {Boolean} force (optional) true to force a recalculation of the value.
608 * @return {Number} The width of the scrollbar.
610 getScrollBarWidth: function(force){
615 if(force === true || scrollWidth === null){
617 // When IE9 positions an element offscreen via offsets, the offsetWidth is
618 // inaccurately reported. For IE9 only, we render on screen before removing.
619 var cssClass = Ext.isIE9 ? '' : Ext.baseCSSPrefix + 'hide-offsets';
620 // Append our div, do our calculation and then remove it
621 var div = Ext.getBody().createChild('<div class="' + cssClass + '" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),
622 child = div.child('div', true);
623 var w1 = child.offsetWidth;
624 div.setStyle('overflow', (Ext.isWebKit || Ext.isGecko) ? 'auto' : 'scroll');
625 var w2 = child.offsetWidth;
627 // Need to add 2 to ensure we leave enough space
628 scrollWidth = w1 - w2 + 2;
633 <span id='Ext-method-copyTo'> /**
634 </span> * Copies a set of named properties fom the source object to the destination object.
635 * <p>example:<pre><code>
636 ImageComponent = Ext.extend(Ext.Component, {
637 initComponent: function() {
638 this.autoEl = { tag: 'img' };
639 MyComponent.superclass.initComponent.apply(this, arguments);
640 this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height');
643 * </code></pre>
644 * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
645 * @param {Object} dest The destination object.
646 * @param {Object} source The source object.
647 * @param {Array/String} names Either an Array of property names, or a comma-delimited list
648 * of property names to copy.
649 * @param {Boolean} usePrototypeKeys (Optional) Defaults to false. Pass true to copy keys off of the prototype as well as the instance.
650 * @return {Object} The modified object.
652 copyTo : function(dest, source, names, usePrototypeKeys){
653 if(typeof names == 'string'){
654 names = names.split(/[,;\s]/);
656 Ext.each(names, function(name){
657 if(usePrototypeKeys || source.hasOwnProperty(name)){
658 dest[name] = source[name];
664 <span id='Ext-method-destroyMembers'> /**
665 </span> * Attempts to destroy and then remove a set of named properties of the passed object.
666 * @param {Object} o The object (most likely a Component) who's properties you wish to destroy.
667 * @param {Mixed} arg1 The name of the property to destroy and remove from the object.
668 * @param {Mixed} etc... More property names to destroy and remove.
670 destroyMembers : function(o, arg1, arg2, etc){
671 for (var i = 1, a = arguments, len = a.length; i < len; i++) {
672 Ext.destroy(o[a[i]]);
677 <span id='Ext-method-log'> /**
678 </span> * Logs a message. If a console is present it will be used. On Opera, the method
679 * "opera.postError" is called. In other cases, the message is logged to an array
680 * "Ext.log.out". An attached debugger can watch this array and view the log. The
681 * log buffer is limited to a maximum of "Ext.log.max" entries (defaults to 100).
683 * If additional parameters are passed, they are joined and appended to the message.
685 * This method does nothing in a release build.
687 * @param {String|Object} message The message to log or an options object with any
688 * of the following properties:
690 * - `msg`: The message to log (required).
691 * - `level`: One of: "error", "warn", "info" or "log" (the default is "log").
692 * - `dump`: An object to dump to the log as part of the message.
693 * - `stack`: True to include a stack trace in the log.
696 log : function (message) {
699 con = Ext.global.console,
706 if (!Ext.isString(message)) {
708 message = options.msg || '';
709 level = options.level || level;
711 stack = options.stack;
713 if (dump && !(con && con.dir)) {
716 // Cannot use Ext.encode since it can recurse endlessly (if we're lucky)
717 // ...and the data could be prettier!
718 Ext.Object.each(dump, function (name, value) {
719 if (typeof(value) === "function") {
723 if (!Ext.isDefined(value) || value === null ||
725 Ext.isString(value) || (typeof(value) == "number") ||
726 Ext.isBoolean(value)) {
727 member = Ext.encode(value);
728 } else if (Ext.isArray(value)) {
730 } else if (Ext.isObject(value)) {
733 member = 'undefined';
735 members.push(Ext.encode(name) + ': ' + member);
738 if (members.length) {
739 message += ' \nData: {\n ' + members.join(',\n ') + '\n}';
745 if (arguments.length > 1) {
746 message += Array.prototype.slice.call(arguments, 1).join('');
749 // Not obvious, but 'console' comes and goes when Firebug is turned on/off, so
750 // an early test may fail either direction if Firebug is toggled.
752 if (con) { // if (Firebug-like console)
763 if (stack && con.trace) {
764 // Firebug's console.error() includes a trace already...
765 if (!con.firebug || level != 'error') {
770 // w/o console, all messages are equal, so munge the level into the message:
771 if (level != 'log') {
772 message = level.toUpperCase() + ': ' + message;
776 opera.postError(message);
778 var out = log.out || (log.out = []),
779 max = log.max || (log.max = 100);
781 if (out.length >= max) {
782 // this formula allows out.max to change (via debugger), where the
783 // more obvious "max/4" would not quite be the same
784 out.splice(0, out.length - 3 * Math.floor(max / 4)); // keep newest 75%
791 // Mostly informational, but the Ext.Error notifier uses them:
792 var counters = log.counters ||
793 (log.counters = { error: 0, warn: 0, info: 0, log: 0 });
799 <span id='Ext-method-partition'> /**
800 </span> * Partitions the set into two sets: a true set and a false set.
803 * <pre><code>
805 Ext.partition([true, false, true, true, false]); // [[true, true, true], [false, false]]
809 Ext.query("p"),
811 return val.className == "class1"
814 // true are those paragraph elements with a className of "class1",
815 // false set are those that do not have that className.
816 * </code></pre>
817 * @param {Array|NodeList} arr The array to partition
818 * @param {Function} truth (optional) a function to determine truth. If this is omitted the element
819 * itself must be able to be evaluated for its truthfulness.
820 * @return {Array} [true<Array>,false<Array>]
821 * @deprecated 4.0.0 Will be removed in the next major version
823 partition : function(arr, truth){
825 Ext.each(arr, function(v, i, a) {
826 ret[ (truth && truth(v, i, a)) || (!truth && v) ? 0 : 1].push(v);
831 <span id='Ext-method-invoke'> /**
832 </span> * Invokes a method on each item in an Array.
833 * <pre><code>
835 Ext.invoke(Ext.query("p"), "getAttribute", "id");
836 // [el1.getAttribute("id"), el2.getAttribute("id"), ..., elN.getAttribute("id")]
837 * </code></pre>
838 * @param {Array|NodeList} arr The Array of items to invoke the method on.
839 * @param {String} methodName The method name to invoke.
840 * @param {...*} args Arguments to send into the method invocation.
841 * @return {Array} The results of invoking the method on each item in the array.
842 * @deprecated 4.0.0 Will be removed in the next major version
844 invoke : function(arr, methodName){
846 args = Array.prototype.slice.call(arguments, 2);
847 Ext.each(arr, function(v,i) {
848 if (v && typeof v[methodName] == 'function') {
849 ret.push(v[methodName].apply(v, args));
857 <span id='Ext-method-zip'> /**
858 </span> * <p>Zips N sets together.</p>
859 * <pre><code>
861 Ext.zip([1,2,3],[4,5,6]); // [[1,4],[2,5],[3,6]]
864 [ "+", "-", "+"],
868 return "$" + a + "" + b + "." + c
870 ); // ["$+12.43", "$-10.15", "$+22.96"]
871 * </code></pre>
872 * @param {Arrays|NodeLists} arr This argument may be repeated. Array(s) to contribute values.
873 * @param {Function} zipper (optional) The last item in the argument list. This will drive how the items are zipped together.
874 * @return {Array} The zipped set.
875 * @deprecated 4.0.0 Will be removed in the next major version
878 var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }),
881 len = Ext.max(Ext.pluck(arrs, "length")),
884 for (var i = 0; i < len; i++) {
887 ret[i] = fn.apply(fn, Ext.pluck(arrs, i));
889 for (var j = 0, aLen = arrs.length; j < aLen; j++){
890 ret[i].push( arrs[j][i] );
897 <span id='Ext-method-toSentence'> /**
898 </span> * Turns an array into a sentence, joined by a specified connector - e.g.:
899 * Ext.toSentence(['Adama', 'Tigh', 'Roslin']); //'Adama, Tigh and Roslin'
900 * Ext.toSentence(['Adama', 'Tigh', 'Roslin'], 'or'); //'Adama, Tigh or Roslin'
901 * @param {Array} items The array to create a sentence from
902 * @param {String} connector The string to use to connect the last two words. Usually 'and' or 'or' - defaults to 'and'.
903 * @return {String} The sentence string
904 * @deprecated 4.0.0 Will be removed in the next major version
906 toSentence: function(items, connector) {
907 var length = items.length;
909 if (length <= 1) {
912 var head = items.slice(0, length - 1),
913 tail = items[length - 1];
915 return Ext.util.Format.format("{0} {1} {2}", head.join(", "), connector || 'and', tail);
919 <span id='Ext-property-useShims'> /**
920 </span> * By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash,
921 * you may want to set this to true.
928 <span id='Ext-method-application'>/**
930 * @param {Object} config
933 Ext.application = function(config) {
934 Ext.require('Ext.app.Application');
936 Ext.onReady(function() {
937 Ext.create('Ext.app.Application', config);