4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/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 windowId: 'ext-window',
52 documentId: 'ext-document',
54 <span id='Ext-property-isReady'> /**
55 </span> * True when the document is fully initialized and ready for action
60 <span id='Ext-property-enableGarbageCollector'> /**
61 </span> * True to automatically uncache orphaned Ext.Elements periodically
64 enableGarbageCollector: true,
66 <span id='Ext-property-enableListenerCollection'> /**
67 </span> * True to automatically purge event listeners during garbageCollection.
70 enableListenerCollection: true,
72 <span id='Ext-method-id'> /**
73 </span> * Generates unique ids. If the element already has an id, it is unchanged
74 * @param {HTMLElement/Ext.Element} el (optional) The element to generate an id for
75 * @param {String} prefix (optional) Id prefix (defaults "ext-gen")
76 * @return {String} The generated Id.
78 id: function(el, prefix) {
81 el = Ext.getDom(el, true) || {};
82 if (el === document) {
83 el.id = me.documentId;
85 else if (el === window) {
90 if (!me.uniqueGlobalNamespace) {
91 me.getUniqueGlobalNamespace();
93 sandboxPrefix = me.uniqueGlobalNamespace + '-';
95 el.id = sandboxPrefix + (prefix || "ext-gen") + (++Ext.idSeed);
100 <span id='Ext-method-getBody'> /**
101 </span> * Returns the current document body as an {@link Ext.Element}.
102 * @return Ext.Element The document body
104 getBody: function() {
105 return Ext.get(document.body || false);
108 <span id='Ext-method-getHead'> /**
109 </span> * Returns the current document head as an {@link Ext.Element}.
110 * @return Ext.Element The document head
113 getHead: function() {
117 if (head == undefined) {
118 head = Ext.get(document.getElementsByTagName("head")[0]);
125 <span id='Ext-method-getDoc'> /**
126 </span> * Returns the current HTML document object as an {@link Ext.Element}.
127 * @return Ext.Element The document
130 return Ext.get(document);
133 <span id='Ext-method-getCmp'> /**
134 </span> * This is shorthand reference to {@link Ext.ComponentManager#get}.
135 * Looks up an existing {@link Ext.Component Component} by {@link Ext.Component#id id}
136 * @param {String} id The component {@link Ext.Component#id id}
137 * @return Ext.Component The Component, <tt>undefined</tt> if not found, or <tt>null</tt> if a
140 getCmp: function(id) {
141 return Ext.ComponentManager.get(id);
144 <span id='Ext-method-getOrientation'> /**
145 </span> * Returns the current orientation of the mobile device
146 * @return {String} Either 'portrait' or 'landscape'
148 getOrientation: function() {
149 return window.innerHeight > window.innerWidth ? 'portrait' : 'landscape';
152 <span id='Ext-method-destroy'> /**
153 </span> * Attempts to destroy any objects passed to it by removing all event listeners, removing them from the
154 * DOM (if applicable) and calling their destroy functions (if available). This method is primarily
155 * intended for arguments of type {@link Ext.Element} and {@link Ext.Component}, but any subclass of
156 * {@link Ext.util.Observable} can be passed in. Any number of elements and/or components can be
157 * passed into this function in a single call as separate arguments.
158 * @param {Ext.Element/Ext.Component/Ext.Element[]/Ext.Component[]...} arg1
159 * An {@link Ext.Element}, {@link Ext.Component}, or an Array of either of these to destroy
161 destroy: function() {
162 var ln = arguments.length,
165 for (i = 0; i < ln; i++) {
168 if (Ext.isArray(arg)) {
169 this.destroy.apply(this, arg);
171 else if (Ext.isFunction(arg.destroy)) {
181 <span id='Ext-method-callback'> /**
182 </span> * Execute a callback function in a particular scope. If no function is passed the call is ignored.
184 * For example, these lines are equivalent:
186 * Ext.callback(myFunc, this, [arg1, arg2]);
187 * Ext.isFunction(myFunc) && myFunc.apply(this, [arg1, arg2]);
189 * @param {Function} callback The callback to execute
190 * @param {Object} scope (optional) The scope to execute in
191 * @param {Array} args (optional) The arguments to pass to the function
192 * @param {Number} delay (optional) Pass a number to delay the call by a number of milliseconds.
194 callback: function(callback, scope, args, delay){
195 if(Ext.isFunction(callback)){
197 scope = scope || window;
199 Ext.defer(callback, delay, scope, args);
201 callback.apply(scope, args);
206 <span id='Ext-method-htmlEncode'> /**
207 </span> * Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pages.
208 * @param {String} value The string to encode
209 * @return {String} The encoded text
211 htmlEncode : function(value) {
212 return Ext.String.htmlEncode(value);
215 <span id='Ext-method-htmlDecode'> /**
216 </span> * Convert certain characters (&, <, >, and ') from their HTML character equivalents.
217 * @param {String} value The string to decode
218 * @return {String} The decoded text
220 htmlDecode : function(value) {
221 return Ext.String.htmlDecode(value);
224 <span id='Ext-method-urlAppend'> /**
225 </span> * Appends content to the query string of a URL, handling logic for whether to place
226 * a question mark or ampersand.
227 * @param {String} url The URL to append to.
228 * @param {String} s The content to append to the URL.
229 * @return (String) The resulting URL
231 urlAppend : function(url, s) {
232 if (!Ext.isEmpty(s)) {
233 return url + (url.indexOf('?') === -1 ? '?' : '&') + s;
240 Ext.ns = Ext.namespace;
243 window.undefined = window.undefined;
247 * Ext core utilities and functions.
252 FF 3.6 - Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17
253 FF 4.0.1 - Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
254 FF 5.0 - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
256 IE6 - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;)
257 IE7 - Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1;)
258 IE8 - Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
259 IE9 - Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
261 Chrome 11 - Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.60 Safari/534.24
263 Safari 5 - Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1
265 Opera 11.11 - Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.11
267 var check = function(regex){
268 return regex.test(Ext.userAgent);
270 isStrict = document.compatMode == "CSS1Compat",
271 version = function (is, regex) {
273 return (is && (m = regex.exec(Ext.userAgent))) ? parseFloat(m[1]) : 0;
275 docMode = document.documentMode,
276 isOpera = check(/opera/),
277 isOpera10_5 = isOpera && check(/version\/10\.5/),
278 isChrome = check(/\bchrome\b/),
279 isWebKit = check(/webkit/),
280 isSafari = !isChrome && check(/safari/),
281 isSafari2 = isSafari && check(/applewebkit\/4/), // unique to Safari 2
282 isSafari3 = isSafari && check(/version\/3/),
283 isSafari4 = isSafari && check(/version\/4/),
284 isSafari5 = isSafari && check(/version\/5/),
285 isIE = !isOpera && check(/msie/),
286 isIE7 = isIE && (check(/msie 7/) || docMode == 7),
287 isIE8 = isIE && (check(/msie 8/) && docMode != 7 && docMode != 9 || docMode == 8),
288 isIE9 = isIE && (check(/msie 9/) && docMode != 7 && docMode != 8 || docMode == 9),
289 isIE6 = isIE && check(/msie 6/),
290 isGecko = !isWebKit && check(/gecko/),
291 isGecko3 = isGecko && check(/rv:1\.9/),
292 isGecko4 = isGecko && check(/rv:2\.0/),
293 isGecko5 = isGecko && check(/rv:5\./),
294 isFF3_0 = isGecko3 && check(/rv:1\.9\.0/),
295 isFF3_5 = isGecko3 && check(/rv:1\.9\.1/),
296 isFF3_6 = isGecko3 && check(/rv:1\.9\.2/),
297 isWindows = check(/windows|win32/),
298 isMac = check(/macintosh|mac os x/),
299 isLinux = check(/linux/),
300 scrollbarSize = null,
301 chromeVersion = version(true, /\bchrome\/(\d+\.\d+)/),
302 firefoxVersion = version(true, /\bfirefox\/(\d+\.\d+)/),
303 ieVersion = version(isIE, /msie (\d+\.\d+)/),
304 operaVersion = version(isOpera, /version\/(\d+\.\d+)/),
305 safariVersion = version(isSafari, /version\/(\d+\.\d+)/),
306 webKitVersion = version(isWebKit, /webkit\/(\d+\.\d+)/),
307 isSecure = /^https/i.test(window.location.protocol);
309 // remove css image flicker
311 document.execCommand("BackgroundImageCache", false, true);
315 function dumpObject (object) {
316 var member, members = [];
318 // Cannot use Ext.encode since it can recurse endlessly (if we're lucky)
319 // ...and the data could be prettier!
320 Ext.Object.each(object, function (name, value) {
321 if (typeof(value) === "function") {
325 if (!Ext.isDefined(value) || value === null ||
327 Ext.isString(value) || (typeof(value) == "number") ||
328 Ext.isBoolean(value)) {
329 member = Ext.encode(value);
330 } else if (Ext.isArray(value)) {
332 } else if (Ext.isObject(value)) {
335 member = 'undefined';
337 members.push(Ext.encode(name) + ': ' + member);
340 if (members.length) {
341 return ' \nData: {\n ' + members.join(',\n ') + '\n}';
346 function log (message) {
348 con = Ext.global.console,
350 indent = log.indent || 0,
355 if (!Ext.isString(message)) {
357 message = options.msg || '';
358 level = options.level || level;
360 stack = options.stack;
362 if (options.indent) {
364 } else if (options.outdent) {
365 log.indent = indent = Math.max(indent - 1, 0);
368 if (dump && !(con && con.dir)) {
369 message += dumpObject(dump);
374 if (arguments.length > 1) {
375 message += Array.prototype.slice.call(arguments, 1).join('');
378 message = indent ? Ext.String.repeat(' ', indent) + message : message;
379 // w/o console, all messages are equal, so munge the level into the message:
380 if (level != 'log') {
381 message = '[' + level.charAt(0).toUpperCase() + '] ' + message;
384 // Not obvious, but 'console' comes and goes when Firebug is turned on/off, so
385 // an early test may fail either direction if Firebug is toggled.
387 if (con) { // if (Firebug-like console)
398 if (stack && con.trace) {
399 // Firebug's console.error() includes a trace already...
400 if (!con.firebug || level != 'error') {
406 opera.postError(message);
411 if (out.length >= max) {
412 // this formula allows out.max to change (via debugger), where the
413 // more obvious "max/4" would not quite be the same
414 Ext.Array.erase(out, 0, out.length - 3 * Math.floor(max / 4)); // keep newest 75%
421 // Mostly informational, but the Ext.Error notifier uses them:
423 ++log.counters[level];
427 log.counters = { error: 0, warn: 0, info: 0, log: 0 };
430 log.show = function () {
431 window.open('','extlog').document.write([
432 '<html><head><script type="text/javascript">',
433 'var lastCount = 0;',
434 'function update () {',
435 'var ext = window.opener.Ext,',
436 'extlog = ext && ext.log;',
437 'if (extlog && extlog.out && lastCount != extlog.count) {',
438 'lastCount = extlog.count;',
439 'var s = "<tt>" + extlog.out.join("<br>").replace(/[ ]/g, "&nbsp;") + "</tt>";',
440 'document.body.innerHTML = s;',
442 'setTimeout(update, 1000);',
444 'setTimeout(update, 1000);',
445 '</script></head><body></body></html>'].join(''));
449 Ext.setVersion('extjs', '4.0.7');
451 <span id='Ext-property-SSL_SECURE_URL'> /**
452 </span> * URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent
453 * the IE insecure content warning (<tt>'about:blank'</tt>, except for IE in secure mode, which is <tt>'javascript:""'</tt>).
456 SSL_SECURE_URL : isSecure && isIE ? 'javascript:""' : 'about:blank',
458 <span id='Ext-property-enableFx'> /**
459 </span> * True if the {@link Ext.fx.Anim} Class is available
464 <span id='Ext-property-scopeResetCSS'> /**
465 </span> * True to scope the reset CSS to be just applied to Ext components. Note that this wraps root containers
466 * with an additional element. Also remember that when you turn on this option, you have to use ext-all-scoped {
467 * unless you use the bootstrap.js to load your javascript, in which case it will be handled for you.
470 scopeResetCSS : Ext.buildSettings.scopeResetCSS,
472 <span id='Ext-property-enableNestedListenerRemoval'> /**
473 </span> * EXPERIMENTAL - True to cascade listener removal to child elements when an element is removed.
474 * Currently not optimized for performance.
477 enableNestedListenerRemoval : false,
479 <span id='Ext-property-USE_NATIVE_JSON'> /**
480 </span> * Indicates whether to use native browser parsing for JSON methods.
481 * This option is ignored if the browser does not support native JSON methods.
482 * <b>Note: Native JSON methods will not work with objects that have functions.
483 * Also, property names must be quoted, otherwise the data will not parse.</b> (Defaults to false)
486 USE_NATIVE_JSON : false,
488 <span id='Ext-method-getDom'> /**
489 </span> * Return the dom node for the passed String (id), dom node, or Ext.Element.
490 * Optional 'strict' flag is needed for IE since it can return 'name' and
491 * 'id' elements by using getElementById.
492 * Here are some examples:
493 * <pre><code>
494 // gets dom node based on id
495 var elDom = Ext.getDom('elId');
496 // gets dom node based on the dom node
497 var elDom1 = Ext.getDom(elDom);
499 // If we don&#39;t know if we are working with an
500 // Ext.Element or a dom node use Ext.getDom
502 var dom = Ext.getDom(el);
503 // do something with the dom node
505 * </code></pre>
506 * <b>Note</b>: the dom node to be found actually needs to exist (be rendered, etc)
507 * when this method is called to be successful.
508 * @param {String/HTMLElement/Ext.Element} el
509 * @return HTMLElement
511 getDom : function(el, strict) {
512 if (!el || !document) {
518 if (typeof el == 'string') {
519 var e = document.getElementById(el);
520 // IE returns elements with the 'name' and 'id' attribute.
521 // we do a strict check to return the element with only the id attribute
522 if (e && isIE && strict) {
523 if (el == e.getAttribute('id')) {
536 <span id='Ext-method-removeNode'> /**
537 </span> * Removes a DOM node from the document.
538 * <p>Removes this element from the document, removes all DOM event listeners, and deletes the cache reference.
539 * All DOM event listeners are removed from this element. If {@link Ext#enableNestedListenerRemoval Ext.enableNestedListenerRemoval} is
540 * <code>true</code>, then DOM event listeners are also removed from all child nodes. The body node
541 * will be ignored if passed in.</p>
542 * @param {HTMLElement} node The node to remove
545 removeNode : isIE6 || isIE7 ? function() {
548 if(n && n.tagName != 'BODY'){
549 (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n) : Ext.EventManager.removeAll(n);
550 d = d || document.createElement('div');
553 delete Ext.cache[n.id];
557 if (n && n.parentNode && n.tagName != 'BODY') {
558 (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n) : Ext.EventManager.removeAll(n);
559 n.parentNode.removeChild(n);
560 delete Ext.cache[n.id];
566 isIEQuirks: isIE && !isStrict,
568 <span id='Ext-property-isOpera'> /**
569 </span> * True if the detected browser is Opera.
574 <span id='Ext-property-isOpera10_5'> /**
575 </span> * True if the detected browser is Opera 10.5x.
578 isOpera10_5 : isOpera10_5,
580 <span id='Ext-property-isWebKit'> /**
581 </span> * True if the detected browser uses WebKit.
586 <span id='Ext-property-isChrome'> /**
587 </span> * True if the detected browser is Chrome.
592 <span id='Ext-property-isSafari'> /**
593 </span> * True if the detected browser is Safari.
598 <span id='Ext-property-isSafari3'> /**
599 </span> * True if the detected browser is Safari 3.x.
602 isSafari3 : isSafari3,
604 <span id='Ext-property-isSafari4'> /**
605 </span> * True if the detected browser is Safari 4.x.
608 isSafari4 : isSafari4,
610 <span id='Ext-property-isSafari5'> /**
611 </span> * True if the detected browser is Safari 5.x.
614 isSafari5 : isSafari5,
616 <span id='Ext-property-isSafari2'> /**
617 </span> * True if the detected browser is Safari 2.x.
620 isSafari2 : isSafari2,
622 <span id='Ext-property-isIE'> /**
623 </span> * True if the detected browser is Internet Explorer.
628 <span id='Ext-property-isIE6'> /**
629 </span> * True if the detected browser is Internet Explorer 6.x.
634 <span id='Ext-property-isIE7'> /**
635 </span> * True if the detected browser is Internet Explorer 7.x.
640 <span id='Ext-property-isIE8'> /**
641 </span> * True if the detected browser is Internet Explorer 8.x.
646 <span id='Ext-property-isIE9'> /**
647 </span> * True if the detected browser is Internet Explorer 9.x.
652 <span id='Ext-property-isGecko'> /**
653 </span> * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
658 <span id='Ext-property-isGecko3'> /**
659 </span> * True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x).
664 <span id='Ext-property-isGecko4'> /**
665 </span> * True if the detected browser uses a Gecko 2.0+ layout engine (e.g. Firefox 4.x).
670 <span id='Ext-property-isGecko5'> /**
671 </span> * True if the detected browser uses a Gecko 5.0+ layout engine (e.g. Firefox 5.x).
676 <span id='Ext-property-isFF3_0'> /**
677 </span> * True if the detected browser uses FireFox 3.0
682 <span id='Ext-property-isFF3_5'> /**
683 </span> * True if the detected browser uses FireFox 3.5
688 <span id='Ext-property-isFF3_6'> /**
689 </span> * True if the detected browser uses FireFox 3.6
694 <span id='Ext-property-isFF4'> /**
695 </span> * True if the detected browser uses FireFox 4
698 isFF4 : 4 <= firefoxVersion && firefoxVersion < 5,
700 <span id='Ext-property-isFF5'> /**
701 </span> * True if the detected browser uses FireFox 5
704 isFF5 : 5 <= firefoxVersion && firefoxVersion < 6,
706 <span id='Ext-property-isLinux'> /**
707 </span> * True if the detected platform is Linux.
712 <span id='Ext-property-isWindows'> /**
713 </span> * True if the detected platform is Windows.
716 isWindows : isWindows,
718 <span id='Ext-property-isMac'> /**
719 </span> * True if the detected platform is Mac OS.
724 <span id='Ext-property-chromeVersion'> /**
725 </span> * The current version of Chrome (0 if the browser is not Chrome).
728 chromeVersion: chromeVersion,
730 <span id='Ext-property-firefoxVersion'> /**
731 </span> * The current version of Firefox (0 if the browser is not Firefox).
734 firefoxVersion: firefoxVersion,
736 <span id='Ext-property-ieVersion'> /**
737 </span> * The current version of IE (0 if the browser is not IE). This does not account
738 * for the documentMode of the current page, which is factored into {@link #isIE7},
739 * {@link #isIE8} and {@link #isIE9}. Thus this is not always true:
741 * Ext.isIE8 == (Ext.ieVersion == 8)
746 ieVersion: ieVersion,
748 <span id='Ext-property-operaVersion'> /**
749 </span> * The current version of Opera (0 if the browser is not Opera).
752 operaVersion: operaVersion,
754 <span id='Ext-property-safariVersion'> /**
755 </span> * The current version of Safari (0 if the browser is not Safari).
758 safariVersion: safariVersion,
760 <span id='Ext-property-webKitVersion'> /**
761 </span> * The current version of WebKit (0 if the browser does not use WebKit).
764 webKitVersion: webKitVersion,
766 <span id='Ext-property-isSecure'> /**
767 </span> * True if the page is running over SSL
772 <span id='Ext-property-BLANK_IMAGE_URL'> /**
773 </span> * URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images.
774 * In older versions of IE, this defaults to "http://sencha.com/s.gif" and you should change this to a URL on your server.
775 * For other browsers it uses an inline data URL.
778 BLANK_IMAGE_URL : (isIE6 || isIE7) ? '/' + '/www.sencha.com/s.gif' : 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
780 <span id='Ext-method-value'> /**
781 </span> * <p>Utility method for returning a default value if the passed value is empty.</p>
782 * <p>The value is deemed to be empty if it is<div class="mdetail-params"><ul>
783 * <li>null</li>
784 * <li>undefined</li>
785 * <li>an empty array</li>
786 * <li>a zero length string (Unless the <tt>allowBlank</tt> parameter is <tt>true</tt>)</li>
787 * </ul></div>
788 * @param {Object} value The value to test
789 * @param {Object} defaultValue The value to return if the original value is empty
790 * @param {Boolean} allowBlank (optional) true to allow zero length strings to qualify as non-empty (defaults to false)
791 * @return {Object} value, if non-empty, else defaultValue
792 * @deprecated 4.0.0 Use {@link Ext#valueFrom} instead
794 value : function(v, defaultValue, allowBlank){
795 return Ext.isEmpty(v, allowBlank) ? defaultValue : v;
798 <span id='Ext-method-escapeRe'> /**
799 </span> * Escapes the passed string for use in a regular expression
800 * @param {String} str
802 * @deprecated 4.0.0 Use {@link Ext.String#escapeRegex} instead
804 escapeRe : function(s) {
805 return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1");
808 <span id='Ext-method-addBehaviors'> /**
809 </span> * Applies event listeners to elements by selectors when the document is ready.
810 * The event name is specified with an <tt>&#64;</tt> suffix.
811 * <pre><code>
813 // add a listener for click on all anchors in element with id foo
814 '#foo a&#64;click' : function(e, t){
818 // add the same listener to multiple selectors (separated by comma BEFORE the &#64;)
819 '#foo a, #bar span.some-class&#64;mouseover' : function(){
823 * </code></pre>
824 * @param {Object} obj The list of behaviors to apply
826 addBehaviors : function(o){
828 Ext.onReady(function(){
832 var cache = {}, // simple cache for applying multiple behaviors to same selector does query multiple times
837 if ((parts = b.split('@'))[1]) { // for Object prototype breakers
840 cache[s] = Ext.select(s);
842 cache[s].on(parts[1], o[b]);
849 <span id='Ext-method-getScrollbarSize'> /**
850 </span> * Returns the size of the browser scrollbars. This can differ depending on
851 * operating system settings, such as the theme or font size.
852 * @param {Boolean} force (optional) true to force a recalculation of the value.
853 * @return {Object} An object containing the width of a vertical scrollbar and the
854 * height of a horizontal scrollbar.
856 getScrollbarSize: function (force) {
861 if(force === true || scrollbarSize === null){
863 // When IE9 positions an element offscreen via offsets, the offsetWidth is
864 // inaccurately reported. For IE9 only, we render on screen before removing.
865 var cssClass = Ext.isIE9 ? '' : Ext.baseCSSPrefix + 'hide-offsets',
866 // Append our div, do our calculation and then remove it
867 div = Ext.getBody().createChild('<div class="' + cssClass + '" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),
868 child = div.child('div', true),
869 w1 = child.offsetWidth;
871 div.setStyle('overflow', (Ext.isWebKit || Ext.isGecko) ? 'auto' : 'scroll');
873 var w2 = child.offsetWidth, width = w1 - w2;
876 // We assume width == height for now. TODO: is this always true?
877 scrollbarSize = { width: width, height: width };
880 return scrollbarSize;
883 <span id='Ext-method-getScrollBarWidth'> /**
884 </span> * Utility method for getting the width of the browser's vertical scrollbar. This
885 * can differ depending on operating system settings, such as the theme or font size.
887 * This method is deprected in favor of {@link #getScrollbarSize}.
889 * @param {Boolean} force (optional) true to force a recalculation of the value.
890 * @return {Number} The width of a vertical scrollbar.
893 getScrollBarWidth: function(force){
894 var size = Ext.getScrollbarSize(force);
895 return size.width + 2; // legacy fudge factor
898 <span id='Ext-method-copyTo'> /**
899 </span> * Copies a set of named properties fom the source object to the destination object.
903 * ImageComponent = Ext.extend(Ext.Component, {
904 * initComponent: function() {
905 * this.autoEl = { tag: 'img' };
906 * MyComponent.superclass.initComponent.apply(this, arguments);
907 * this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height');
911 * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
913 * @param {Object} dest The destination object.
914 * @param {Object} source The source object.
915 * @param {String/String[]} names Either an Array of property names, or a comma-delimited list
916 * of property names to copy.
917 * @param {Boolean} usePrototypeKeys (Optional) Defaults to false. Pass true to copy keys off of the prototype as well as the instance.
918 * @return {Object} The modified object.
920 copyTo : function(dest, source, names, usePrototypeKeys){
921 if(typeof names == 'string'){
922 names = names.split(/[,;\s]/);
924 Ext.each(names, function(name){
925 if(usePrototypeKeys || source.hasOwnProperty(name)){
926 dest[name] = source[name];
932 <span id='Ext-method-destroyMembers'> /**
933 </span> * Attempts to destroy and then remove a set of named properties of the passed object.
934 * @param {Object} o The object (most likely a Component) who's properties you wish to destroy.
935 * @param {String...} args One or more names of the properties to destroy and remove from the object.
937 destroyMembers : function(o){
938 for (var i = 1, a = arguments, len = a.length; i < len; i++) {
939 Ext.destroy(o[a[i]]);
944 <span id='Ext-property-log'> /**
945 </span> * Logs a message. If a console is present it will be used. On Opera, the method
946 * "opera.postError" is called. In other cases, the message is logged to an array
947 * "Ext.log.out". An attached debugger can watch this array and view the log. The
948 * log buffer is limited to a maximum of "Ext.log.max" entries (defaults to 250).
949 * The `Ext.log.out` array can also be written to a popup window by entering the
950 * following in the URL bar (a "bookmarklet"):
952 * javascript:void(Ext.log.show());
954 * If additional parameters are passed, they are joined and appended to the message.
955 * A technique for tracing entry and exit of a function is this:
958 * Ext.log({ indent: 1 }, '>> foo');
960 * // log statements in here or methods called from here will be indented
963 * Ext.log({ outdent: 1 }, '<< foo');
966 * This method does nothing in a release build.
968 * @param {String/Object} message The message to log or an options object with any
969 * of the following properties:
971 * - `msg`: The message to log (required).
972 * - `level`: One of: "error", "warn", "info" or "log" (the default is "log").
973 * - `dump`: An object to dump to the log as part of the message.
974 * - `stack`: True to include a stack trace in the log.
975 * - `indent`: Cause subsequent log statements to be indented one step.
976 * - `outdent`: Cause this and following statements to be one step less indented.
985 <span id='Ext-method-partition'> /**
986 </span> * Partitions the set into two sets: a true set and a false set.
989 * <pre><code>
991 Ext.partition([true, false, true, true, false]); // [[true, true, true], [false, false]]
995 Ext.query("p"),
997 return val.className == "class1"
1000 // true are those paragraph elements with a className of "class1",
1001 // false set are those that do not have that className.
1002 * </code></pre>
1003 * @param {Array/NodeList} arr The array to partition
1004 * @param {Function} truth (optional) a function to determine truth. If this is omitted the element
1005 * itself must be able to be evaluated for its truthfulness.
1006 * @return {Array} [array of truish values, array of falsy values]
1007 * @deprecated 4.0.0 Will be removed in the next major version
1009 partition : function(arr, truth){
1011 Ext.each(arr, function(v, i, a) {
1012 ret[ (truth && truth(v, i, a)) || (!truth && v) ? 0 : 1].push(v);
1017 <span id='Ext-method-invoke'> /**
1018 </span> * Invokes a method on each item in an Array.
1019 * <pre><code>
1021 Ext.invoke(Ext.query("p"), "getAttribute", "id");
1022 // [el1.getAttribute("id"), el2.getAttribute("id"), ..., elN.getAttribute("id")]
1023 * </code></pre>
1024 * @param {Array/NodeList} arr The Array of items to invoke the method on.
1025 * @param {String} methodName The method name to invoke.
1026 * @param {Object...} args Arguments to send into the method invocation.
1027 * @return {Array} The results of invoking the method on each item in the array.
1028 * @deprecated 4.0.0 Will be removed in the next major version
1030 invoke : function(arr, methodName){
1032 args = Array.prototype.slice.call(arguments, 2);
1033 Ext.each(arr, function(v,i) {
1034 if (v && typeof v[methodName] == 'function') {
1035 ret.push(v[methodName].apply(v, args));
1037 ret.push(undefined);
1043 <span id='Ext-method-zip'> /**
1044 </span> * <p>Zips N sets together.</p>
1045 * <pre><code>
1047 Ext.zip([1,2,3],[4,5,6]); // [[1,4],[2,5],[3,6]]
1050 [ "+", "-", "+"],
1054 return "$" + a + "" + b + "." + c
1056 ); // ["$+12.43", "$-10.15", "$+22.96"]
1057 * </code></pre>
1058 * @param {Array/NodeList...} arr This argument may be repeated. Array(s) to contribute values.
1059 * @param {Function} zipper (optional) The last item in the argument list. This will drive how the items are zipped together.
1060 * @return {Array} The zipped set.
1061 * @deprecated 4.0.0 Will be removed in the next major version
1064 var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }),
1067 len = Ext.max(Ext.pluck(arrs, "length")),
1070 for (var i = 0; i < len; i++) {
1073 ret[i] = fn.apply(fn, Ext.pluck(arrs, i));
1075 for (var j = 0, aLen = arrs.length; j < aLen; j++){
1076 ret[i].push( arrs[j][i] );
1083 <span id='Ext-method-toSentence'> /**
1084 </span> * Turns an array into a sentence, joined by a specified connector - e.g.:
1085 * Ext.toSentence(['Adama', 'Tigh', 'Roslin']); //'Adama, Tigh and Roslin'
1086 * Ext.toSentence(['Adama', 'Tigh', 'Roslin'], 'or'); //'Adama, Tigh or Roslin'
1087 * @param {String[]} items The array to create a sentence from
1088 * @param {String} connector The string to use to connect the last two words. Usually 'and' or 'or' - defaults to 'and'.
1089 * @return {String} The sentence string
1090 * @deprecated 4.0.0 Will be removed in the next major version
1092 toSentence: function(items, connector) {
1093 var length = items.length;
1095 if (length <= 1) {
1098 var head = items.slice(0, length - 1),
1099 tail = items[length - 1];
1101 return Ext.util.Format.format("{0} {1} {2}", head.join(", "), connector || 'and', tail);
1105 <span id='Ext-property-useShims'> /**
1106 </span> * By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash,
1107 * you may want to set this to true.
1114 <span id='Ext-method-application'>/**
1115 </span> * Loads Ext.app.Application class and starts it up with given configuration after the page is ready.
1117 * See Ext.app.Application for details.
1119 * @param {Object} config
1121 Ext.application = function(config) {
1122 Ext.require('Ext.app.Application');
1124 Ext.onReady(function() {
1125 Ext.create('Ext.app.Application', config);