+++ /dev/null
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-/**\r
- * @class Ext.Panel\r
- * @extends Ext.Container\r
- * Panel is a container that has specific functionality and structural components that make it the perfect building\r
- * block for application-oriented user interfaces. The Panel contains bottom and top toolbars, along with separate\r
- * header, footer and body sections. It also provides built-in expandable and collapsible behavior, along with a\r
- * variety of prebuilt tool buttons that can be wired up to provide other customized behavior. Panels can be easily\r
- * dropped into any Container or layout, and the layout and rendering pipeline is completely managed by the framework.\r
- * @constructor\r
- * @param {Object} config The config object\r
- */\r
-Ext.Panel = Ext.extend(Ext.Container, {\r
- /**\r
- * The Panel's header {@link Ext.Element Element}. Read-only.\r
- * <p>This Element is used to house the {@link #title} and {@link #tools}</p>\r
- * @type Ext.Element\r
- * @property header\r
- */\r
- /**\r
- * The Panel's body {@link Ext.Element Element} which may be used to contain HTML content.\r
- * The content may be specified in the {@link #html} config, or it may be loaded using the\r
- * {@link autoLoad} config, or through the Panel's {@link #getUpdater Updater}. Read-only.\r
- * <p>If this is used to load visible HTML elements in either way, then\r
- * the Panel may not be used as a Layout for hosting nested Panels.</p>\r
- * <p>If this Panel is intended to be used as the host of a Layout (See {@link #layout}\r
- * then the body Element must not be loaded or changed - it is under the control\r
- * of the Panel's Layout.\r
- * @type Ext.Element\r
- * @property body\r
- */\r
- /**\r
- * @cfg {Object} bodyCfg\r
- * <p>A {@link Ext.DomHelper DomHelper} configuration object specifying the element structure\r
- * of this Panel's {@link #body} Element.</p>\r
- * <p>This may be used to force the body Element to use a different form of markup than\r
- * is created automatically. An example of this might be to create a child Panel containing\r
- * custom content, such as a header, or forcing centering of all Panel\r
- * content by having the body be a <center> element:</p><code><pre>\r
-new Ext.Panel({\r
- title: 'New Message',\r
- collapsible: true,\r
- renderTo: Ext.getBody(),\r
- width: 400,\r
- bodyCfg: {\r
- tag: 'center',\r
- cls: 'x-panel-body'\r
- },\r
- items: [{\r
- border: false,\r
- header: false,\r
- bodyCfg: {tag: 'h2', html: 'Message'}\r
- }, {\r
- xtype: 'textarea',\r
- style: {\r
- width: '95%',\r
- marginBottom: '10px'\r
- }\r
- },\r
- new Ext.Button({\r
- text: 'Send',\r
- minWidth: '100',\r
- style: {\r
- marginBottom: '10px'\r
- }\r
- })\r
- ]\r
-});</pre></code>\r
- */\r
- /**\r
- * The Panel's footer {@link Ext.Element Element}. Read-only.\r
- * <p>This Element is used to house the Panel's {@link #buttons}.</p>\r
- * @type Ext.Element\r
- * @property footer\r
- */\r
- /**\r
- * @cfg {Mixed} applyTo\r
- * The id of the node, a DOM node or an existing Element corresponding to a DIV that is already present in\r
- * the document that specifies some panel-specific structural markup. When applyTo is used, constituent parts of\r
- * the panel can be specified by CSS class name within the main element, and the panel will automatically create those\r
- * components from that markup. Any required components not specified in the markup will be autogenerated if necessary.\r
- * The following class names are supported (baseCls will be replaced by {@link #baseCls}):\r
- * <ul><li>baseCls + '-header'</li>\r
- * <li>baseCls + '-header-text'</li>\r
- * <li>baseCls + '-bwrap'</li>\r
- * <li>baseCls + '-tbar'</li>\r
- * <li>baseCls + '-body'</li>\r
- * <li>baseCls + '-bbar'</li>\r
- * <li>baseCls + '-footer'</li></ul>\r
- * Using this config, a call to render() is not required. If applyTo is specified, any value passed for\r
- * {@link #renderTo} will be ignored and the target element's parent node will automatically be used as the panel's container.\r
- */\r
- /**\r
- * @cfg {Object/Array} tbar\r
- * The top toolbar of the panel. This can be either an {@link Ext.Toolbar} object or an array of\r
- * buttons/button configs to be added to the toolbar. Note that this is not available as a property after render.\r
- * To access the top toolbar after render, use {@link #getTopToolbar}.\r
- */\r
- /**\r
- * @cfg {Object/Array} bbar\r
- * The bottom toolbar of the panel. This can be either an {@link Ext.Toolbar} object or an array of\r
- * buttons/button configs to be added to the toolbar. Note that this is not available as a property after render.\r
- * To access the bottom toolbar after render, use {@link #getBottomToolbar}.\r
- */\r
- /**\r
- * @cfg {Boolean} header\r
- * True to create the header element explicitly, false to skip creating it. By default, when header is not\r
- * specified, if a {@link #title} is set the header will be created automatically, otherwise it will not. If\r
- * a title is set but header is explicitly set to false, the header will not be rendered.\r
- */\r
- /**\r
- * @cfg {Boolean} footer\r
- * True to create the footer element explicitly, false to skip creating it. By default, when footer is not\r
- * specified, if one or more buttons have been added to the panel the footer will be created automatically,\r
- * otherwise it will not.\r
- */\r
- /**\r
- * @cfg {String} title\r
- * The title text to display in the panel header (defaults to ''). When a title is specified the header\r
- * element will automatically be created and displayed unless {@link #header} is explicitly set to false. If\r
- * you don't want to specify a title at config time, but you may want one later, you must either specify a\r
- * non-empty title (a blank space ' ' will do) or header:true so that the container element will get created.\r
- */\r
- /**\r
- * @cfg {Array} buttons\r
- * An array of {@link Ext.Button}s or {@link Ext.Button} configs used to add buttons to the footer of this panel.\r
- */\r
- /**\r
- * @cfg {Object/String/Function} autoLoad\r
- * A valid url spec according to the Updater {@link Ext.Updater#update} method.\r
- * If autoLoad is not null, the panel will attempt to load its contents\r
- * immediately upon render.<p>\r
- * The URL will become the default URL for this panel's {@link #body} element,\r
- * so it may be {@link Ext.Element#refresh refresh}ed at any time.</p>\r
- */\r
- /**\r
- * @cfg {Boolean} frame\r
- * True to render the panel with custom rounded borders, false to render with plain 1px square borders (defaults to false).\r
- */\r
- /**\r
- * @cfg {Boolean} border\r
- * True to display the borders of the panel's body element, false to hide them (defaults to true). By default,\r
- * the border is a 2px wide inset border, but this can be further altered by setting {@link #bodyBorder} to false.\r
- */\r
- /**\r
- * @cfg {Boolean} bodyBorder\r
- * True to display an interior border on the body element of the panel, false to hide it (defaults to true).\r
- * This only applies when {@link #border} == true. If border == true and bodyBorder == false, the border will display\r
- * as a 1px wide inset border, giving the entire body element an inset appearance.\r
- */\r
- /**\r
- * @cfg {String/Object/Function} bodyStyle\r
- * Custom CSS styles to be applied to the body element in the format expected by {@link Ext.Element#applyStyles}\r
- * (defaults to null).\r
- */\r
- /**\r
- * @cfg {String} iconCls\r
- * A CSS class that will provide a background image to be used as the header icon (defaults to ''). An example\r
- * custom icon class would be something like: .my-icon { background: url(../images/my-icon.gif) 0 6px no-repeat !important;}\r
- */\r
- /**\r
- * @cfg {Boolean} collapsible\r
- * True to make the panel collapsible and have the expand/collapse toggle button automatically rendered into\r
- * the header tool button area, false to keep the panel statically sized with no button (defaults to false).\r
- */\r
- /**\r
- * @cfg {Array} tools\r
- * An array of tool button configs to be added to the header tool area. When rendered, each tool is\r
- * stored as an {@link Ext.Element Element} referenced by a public property called <tt><b></b>tools.<i><tool-type></i></tt>\r
- * <p>Each tool config may contain the following properties:\r
- * <div class="mdetail-params"><ul>\r
- * <li><b>id</b> : String<div class="sub-desc"><b>Required.</b> The type\r
- * of tool to create. Values may be<ul>\r
- * <li><tt>toggle</tt> (Created by default when {@link #collapsible} is <tt>true</tt>)</li>\r
- * <li><tt>close</tt></li>\r
- * <li><tt>minimize</tt></li>\r
- * <li><tt>maximize</tt></li>\r
- * <li><tt>restore</tt></li>\r
- * <li><tt>gear</tt></li>\r
- * <li><tt>pin</tt></li>\r
- * <li><tt>unpin</tt></li>\r
- * <li><tt>right</tt></li>\r
- * <li><tt>left</tt></li>\r
- * <li><tt>up</tt></li>\r
- * <li><tt>down</tt></li>\r
- * <li><tt>refresh</tt></li>\r
- * <li><tt>minus</tt></li>\r
- * <li><tt>plus</tt></li>\r
- * <li><tt>help</tt></li>\r
- * <li><tt>search</tt></li>\r
- * <li><tt>save</tt></li>\r
- * <li><tt>print</tt></li>\r
- * </ul></div></li>\r
- * <li><b>handler</b> : Function<div class="sub-desc"><b>Required.</b> The function to\r
- * call when clicked. Arguments passed are:<ul>\r
- * <li><b>event</b> : Ext.EventObject<div class="sub-desc">The click event.</div></li>\r
- * <li><b>toolEl</b> : Ext.Element<div class="sub-desc">The tool Element.</div></li>\r
- * <li><b>Panel</b> : Ext.Panel<div class="sub-desc">The host Panel</div></li>\r
- * </ul></div></li>\r
- * <li><b>scope</b> : Object<div class="sub-desc">The scope in which to call the handler.</div></li>\r
- * <li><b>qtip</b> : String/Object<div class="sub-desc">A tip string, or\r
- * a config argument to {@link Ext.QuickTip#register}</div></li>\r
- * <li><b>hidden</b> : Boolean<div class="sub-desc">True to initially render hidden.</div></li>\r
- * <li><b>on</b> : Object<div class="sub-desc">A listener config object specifiying\r
- * event listeners in the format of an argument to {@link #addListener}</div></li>\r
- * </ul></div>\r
- * Example usage:\r
- * <pre><code>\r
-tools:[{\r
- id:'refresh',\r
- qtip: 'Refresh form Data',\r
- // hidden:true,\r
- handler: function(event, toolEl, panel){\r
- // refresh logic\r
- }\r
-}]\r
-</code></pre>\r
- * Note that apart from the toggle tool which is provided when a panel is\r
- * collapsible, these tools only provide the visual button. Any required\r
- * functionality must be provided by adding handlers that implement the\r
- * necessary behavior.\r
- */\r
- /**\r
- * @cfg {Boolean} hideCollapseTool\r
- * True to hide the expand/collapse toggle button when {@link #collapsible} = true, false to display it (defaults to false).\r
- */\r
- /**\r
- * @cfg {Boolean} titleCollapse\r
- * True to allow expanding and collapsing the panel (when {@link #collapsible} = true) by clicking anywhere in the\r
- * header bar, false to allow it only by clicking to tool button (defaults to false).\r
- */\r
- /**\r
- * @cfg {Boolean} autoScroll\r
- * True to use overflow:'auto' on the panel's body element and show scroll bars automatically when necessary,\r
- * false to clip any overflowing content (defaults to false).\r
- */\r
- /**\r
- * @cfg {Boolean} floating\r
- * True to float the panel (absolute position it with automatic shimming and shadow), false to display it\r
- * inline where it is rendered (defaults to false). Note that by default, setting floating to true will cause the\r
- * panel to display at negative offsets so that it is hidden -- because the panel is absolute positioned, the\r
- * position must be set explicitly after render (e.g., myPanel.setPosition(100,100);). Also, when floating a\r
- * panel you should always assign a fixed width, otherwise it will be auto width and will expand to fill to the\r
- * right edge of the viewport.\r
- */\r
- /**\r
- * @cfg {Boolean/String} shadow\r
- * True (or a valid Ext.Shadow {@link Ext.Shadow#mode} value) to display a shadow behind the panel, false to\r
- * display no shadow (defaults to 'sides'). Note that this option only applies when floating = true.\r
- */\r
- /**\r
- * @cfg {Number} shadowOffset\r
- * The number of pixels to offset the shadow if displayed (defaults to 4). Note that this option only applies\r
- * when floating = true.\r
- */\r
- /**\r
- * @cfg {Boolean} shim\r
- * False to disable the iframe shim in browsers which need one (defaults to true). Note that this option\r
- * only applies when floating = true.\r
- */\r
- /**\r
- * @cfg {String/Object} html\r
- * An HTML fragment, or a {@link Ext.DomHelper DomHelper} specification to use\r
- * as the panel's body content (defaults to ''). The HTML content is added by the Panel's\r
- * afterRender method, and so the document will not contain this HTML at the time the render\r
- * event is fired. This content is inserted into the body <i>before</i> any configured\r
- * {@link #contentEl} is appended.\r
- */\r
- /**\r
- * @cfg {String} contentEl\r
- * The id of an existing HTML node to use as the panel's body content (defaults to ''). The\r
- * specified Element is appended to the Panel's body Element by the Panel's afterRender method\r
- * <i>after any configured {@link #html HTML} has been inserted</i>, and so the document will\r
- * not contain this HTML at the time the render event is fired.\r
- */\r
- /**\r
- * @cfg {Object/Array} keys\r
- * A KeyMap config object (in the format expected by {@link Ext.KeyMap#addBinding} used to assign custom key\r
- * handling to this panel (defaults to null).\r
- */\r
- /**\r
- * @cfg {Boolean} draggable\r
- * <p>True to enable dragging of this Panel (defaults to false).</p>\r
- * <p>For custom drag/drop implementations, an Ext.Panel.DD\r
- * config could also be passed in this config instead of true. Ext.Panel.DD is an internal,\r
- * undocumented class which moves a proxy Element around in place of the Panel's element, but\r
- * provides no other behaviour during dragging or on drop. It is a subclass of\r
- * {@link Ext.dd.DragSource}, so behaviour may be added by implementing the interface methods\r
- * of {@link Ext.dd.DragDrop} eg:\r
- * <pre><code>\r
-new Ext.Panel({\r
- title: 'Drag me',\r
- x: 100,\r
- y: 100,\r
- renderTo: Ext.getBody(),\r
- floating: true,\r
- frame: true,\r
- width: 400,\r
- height: 200,\r
- draggable: {\r
-// Config option of Ext.Panel.DD class.\r
-// It's a floating Panel, so do not show a placeholder proxy in the original position.\r
- insertProxy: false,\r
-\r
-// Called for each mousemove event while dragging the DD object.\r
- onDrag : function(e){\r
-// Record the x,y position of the drag proxy so that we can\r
-// position the Panel at end of drag.\r
- var pel = this.proxy.getEl();\r
- this.x = pel.getLeft(true);\r
- this.y = pel.getTop(true);\r
-\r
-// Keep the Shadow aligned if there is one.\r
- var s = this.panel.getEl().shadow;\r
- if (s) {\r
- s.realign(this.x, this.y, pel.getWidth(), pel.getHeight());\r
- }\r
- },\r
-\r
-// Called on the mouseup event.\r
- endDrag : function(e){\r
- this.panel.setPosition(this.x, this.y);\r
- }\r
- }\r
-}).show();\r
-</code></pre>\r
- */\r
- /**\r
- * @cfg {String} tabTip\r
- * Adds a tooltip when mousing over the tab of a Ext.Panel which is an item of a Ext.TabPanel. Ext.QuickTips.init()\r
- * must be called in order for the tips to render.\r
- */\r
- /**\r
- * @cfg {Boolean} disabled\r
- * Render this panel disabled (default is false). An important note when using the disabled config on panels is\r
- * that IE will often fail to initialize the disabled mask element correectly if the panel's layout has not yet \r
- * completed by the time the Panel is disabled during the render process. If you experience this issue, you may \r
- * need to instead use the {@link afterlayout} event to initialize the disabled state:\r
- * <pre><code>\r
-new Ext.Panel({\r
- ...\r
- listeners: {\r
- 'afterlayout': {\r
- fn: function(p){\r
- p.disable();\r
- },\r
- single: true // important, as many layouts can occur\r
- }\r
- }\r
-});\r
-</code></pre>\r
- */\r
- /**\r
- * @cfg {Boolean} autoHeight\r
- * True to use height:'auto', false to use fixed height (defaults to false). <b>Note</b>: Setting autoHeight:true \r
- * means that the browser will manage the panel's height based on its contents, and that Ext will not manage it at \r
- * all. If the panel is within a layout that manages dimensions (fit, border, etc.) then setting autoHeight:true\r
- * can cause issues with scrolling and will not generally work as expected since the panel will take on the height\r
- * of its contents rather than the height required by the Ext layout.\r
- */\r
- \r
-\r
- /**\r
- * @cfg {String} baseCls\r
- * The base CSS class to apply to this panel's element (defaults to 'x-panel').\r
- */\r
- baseCls : 'x-panel',\r
- /**\r
- * @cfg {String} collapsedCls\r
- * A CSS class to add to the panel's element after it has been collapsed (defaults to 'x-panel-collapsed').\r
- */\r
- collapsedCls : 'x-panel-collapsed',\r
- /**\r
- * @cfg {Boolean} maskDisabled\r
- * True to mask the panel when it is disabled, false to not mask it (defaults to true). Either way, the panel\r
- * will always tell its contained elements to disable themselves when it is disabled, but masking the panel\r
- * can provide an additional visual cue that the panel is disabled.\r
- */\r
- maskDisabled: true,\r
- /**\r
- * @cfg {Boolean} animCollapse\r
- * True to animate the transition when the panel is collapsed, false to skip the animation (defaults to true\r
- * if the {@link Ext.Fx} class is available, otherwise false).\r
- */\r
- animCollapse: Ext.enableFx,\r
- /**\r
- * @cfg {Boolean} headerAsText\r
- * True to display the panel title in the header, false to hide it (defaults to true).\r
- */\r
- headerAsText: true,\r
- /**\r
- * @cfg {String} buttonAlign\r
- * The alignment of any buttons added to this panel. Valid values are 'right,' 'left' and 'center' (defaults to 'right').\r
- */\r
- buttonAlign: 'right',\r
- /**\r
- * @cfg {Boolean} collapsed\r
- * True to render the panel collapsed, false to render it expanded (defaults to false).\r
- */\r
- collapsed : false,\r
- /**\r
- * @cfg {Boolean} collapseFirst\r
- * True to make sure the collapse/expand toggle button always renders first (to the left of) any other tools\r
- * in the panel's title bar, false to render it last (defaults to true).\r
- */\r
- collapseFirst: true,\r
- /**\r
- * @cfg {Number} minButtonWidth\r
- * Minimum width in pixels of all buttons in this panel (defaults to 75)\r
- */\r
- minButtonWidth:75,\r
- /**\r
- * @cfg {String} elements\r
- * A comma-delimited list of panel elements to initialize when the panel is rendered. Normally, this list will be\r
- * generated automatically based on the items added to the panel at config time, but sometimes it might be useful to\r
- * make sure a structural element is rendered even if not specified at config time (for example, you may want\r
- * to add a button or toolbar dynamically after the panel has been rendered). Adding those elements to this\r
- * list will allocate the required placeholders in the panel when it is rendered. Valid values are<ul>\r
- * <li><b>header</b></li>\r
- * <li><b>tbar</b> (top bar)</li>\r
- * <li><b>body</b> (required)</li>\r
- * <li><b>bbar</b> (bottom bar)</li>\r
- * <li><b>footer</b><li>\r
- * </ul>\r
- * Defaults to 'body'.\r
- */\r
- elements : 'body',\r
-\r
- // protected - these could be used to customize the behavior of the window,\r
- // but changing them would not be useful without further mofifications and\r
- // could lead to unexpected or undesirable results.\r
- toolTarget : 'header',\r
- collapseEl : 'bwrap',\r
- slideAnchor : 't',\r
- disabledClass: '',\r
-\r
- // private, notify box this class will handle heights\r
- deferHeight: true,\r
- // private\r
- expandDefaults: {\r
- duration:.25\r
- },\r
- // private\r
- collapseDefaults: {\r
- duration:.25\r
- },\r
-\r
- // private\r
- initComponent : function(){\r
- Ext.Panel.superclass.initComponent.call(this);\r
-\r
- this.addEvents(\r
- /**\r
- * @event bodyresize\r
- * Fires after the Panel has been resized.\r
- * @param {Ext.Panel} p the Panel which has been resized.\r
- * @param {Number} width The Panel's new width.\r
- * @param {Number} height The Panel's new height.\r
- */\r
- 'bodyresize',\r
- /**\r
- * @event titlechange\r
- * Fires after the Panel title has been set or changed.\r
- * @param {Ext.Panel} p the Panel which has had its title changed.\r
- * @param {String} The new title.\r
- */\r
- 'titlechange',\r
- /**\r
- * @event iconchange\r
- * Fires after the Panel icon class has been set or changed.\r
- * @param {Ext.Panel} p the Panel which has had its icon class changed.\r
- * @param {String} The new icon class.\r
- * @param {String} The old icon class.\r
- */\r
- 'iconchange',\r
- /**\r
- * @event collapse\r
- * Fires after the Panel has been collapsed.\r
- * @param {Ext.Panel} p the Panel that has been collapsed.\r
- */\r
- 'collapse',\r
- /**\r
- * @event expand\r
- * Fires after the Panel has been expanded.\r
- * @param {Ext.Panel} p The Panel that has been expanded.\r
- */\r
- 'expand',\r
- /**\r
- * @event beforecollapse\r
- * Fires before the Panel is collapsed. A handler can return false to cancel the collapse.\r
- * @param {Ext.Panel} p the Panel being collapsed.\r
- * @param {Boolean} animate True if the collapse is animated, else false.\r
- */\r
- 'beforecollapse',\r
- /**\r
- * @event beforeexpand\r
- * Fires before the Panel is expanded. A handler can return false to cancel the expand.\r
- * @param {Ext.Panel} p The Panel being expanded.\r
- * @param {Boolean} animate True if the expand is animated, else false.\r
- */\r
- 'beforeexpand',\r
- /**\r
- * @event beforeclose\r
- * Fires before the Panel is closed. Note that Panels do not directly support being closed, but some\r
- * Panel subclasses do (like {@link Ext.Window}). This event only applies to such subclasses.\r
- * A handler can return false to cancel the close.\r
- * @param {Ext.Panel} p The Panel being closed.\r
- */\r
- 'beforeclose',\r
- /**\r
- * @event close\r
- * Fires after the Panel is closed. Note that Panels do not directly support being closed, but some\r
- * Panel subclasses do (like {@link Ext.Window}).\r
- * @param {Ext.Panel} p The Panel that has been closed.\r
- */\r
- 'close',\r
- /**\r
- * @event activate\r
- * Fires after the Panel has been visually activated.\r
- * Note that Panels do not directly support being activated, but some Panel subclasses\r
- * do (like {@link Ext.Window}). Panels which are child Components of a TabPanel fire the\r
- * activate and deactivate events under the control of the TabPanel.\r
- * @param {Ext.Panel} p The Panel that has been activated.\r
- */\r
- 'activate',\r
- /**\r
- * @event deactivate\r
- * Fires after the Panel has been visually deactivated.\r
- * Note that Panels do not directly support being deactivated, but some Panel subclasses\r
- * do (like {@link Ext.Window}). Panels which are child Components of a TabPanel fire the\r
- * activate and deactivate events under the control of the TabPanel.\r
- * @param {Ext.Panel} p The Panel that has been deactivated.\r
- */\r
- 'deactivate'\r
- );\r
-\r
- // shortcuts\r
- if(this.tbar){\r
- this.elements += ',tbar';\r
- if(typeof this.tbar == 'object'){\r
- this.topToolbar = this.tbar;\r
- }\r
- delete this.tbar;\r
- }\r
- if(this.bbar){\r
- this.elements += ',bbar';\r
- if(typeof this.bbar == 'object'){\r
- this.bottomToolbar = this.bbar;\r
- }\r
- delete this.bbar;\r
- }\r
-\r
- if(this.header === true){\r
- this.elements += ',header';\r
- delete this.header;\r
- }else if(this.title && this.header !== false){\r
- this.elements += ',header';\r
- }\r
-\r
- if(this.footer === true){\r
- this.elements += ',footer';\r
- delete this.footer;\r
- }\r
-\r
- if(this.buttons){\r
- var btns = this.buttons;\r
- /**\r
- * This Panel's Array of buttons as created from the <tt>buttons</tt>\r
- * config property. Read only.\r
- * @type Array\r
- * @property buttons\r
- */\r
- this.buttons = [];\r
- for(var i = 0, len = btns.length; i < len; i++) {\r
- if(btns[i].render){ // button instance\r
- btns[i].ownerCt = this;\r
- this.buttons.push(btns[i]);\r
- }else{\r
- this.addButton(btns[i]);\r
- }\r
- }\r
- }\r
- if(this.autoLoad){\r
- this.on('render', this.doAutoLoad, this, {delay:10});\r
- }\r
- },\r
-\r
- // private\r
- createElement : function(name, pnode){\r
- if(this[name]){\r
- pnode.appendChild(this[name].dom);\r
- return;\r
- }\r
-\r
- if(name === 'bwrap' || this.elements.indexOf(name) != -1){\r
- if(this[name+'Cfg']){\r
- this[name] = Ext.fly(pnode).createChild(this[name+'Cfg']);\r
- }else{\r
- var el = document.createElement('div');\r
- el.className = this[name+'Cls'];\r
- this[name] = Ext.get(pnode.appendChild(el));\r
- }\r
- if(this[name+'CssClass']){\r
- this[name].addClass(this[name+'CssClass']);\r
- }\r
- if(this[name+'Style']){\r
- this[name].applyStyles(this[name+'Style']);\r
- }\r
- }\r
- },\r
-\r
- // private\r
- onRender : function(ct, position){\r
- Ext.Panel.superclass.onRender.call(this, ct, position);\r
-\r
- this.createClasses();\r
-\r
- if(this.el){ // existing markup\r
- this.el.addClass(this.baseCls);\r
- this.header = this.el.down('.'+this.headerCls);\r
- this.bwrap = this.el.down('.'+this.bwrapCls);\r
- var cp = this.bwrap ? this.bwrap : this.el;\r
- this.tbar = cp.down('.'+this.tbarCls);\r
- this.body = cp.down('.'+this.bodyCls);\r
- this.bbar = cp.down('.'+this.bbarCls);\r
- this.footer = cp.down('.'+this.footerCls);\r
- this.fromMarkup = true;\r
- }else{\r
- this.el = ct.createChild({\r
- id: this.id,\r
- cls: this.baseCls\r
- }, position);\r
- }\r
- var el = this.el, d = el.dom;\r
-\r
- if(this.cls){\r
- this.el.addClass(this.cls);\r
- }\r
-\r
- if(this.buttons){\r
- this.elements += ',footer';\r
- }\r
-\r
- // This block allows for maximum flexibility and performance when using existing markup\r
-\r
- // framing requires special markup\r
- if(this.frame){\r
- el.insertHtml('afterBegin', String.format(Ext.Element.boxMarkup, this.baseCls));\r
-\r
- this.createElement('header', d.firstChild.firstChild.firstChild);\r
- this.createElement('bwrap', d);\r
-\r
- // append the mid and bottom frame to the bwrap\r
- var bw = this.bwrap.dom;\r
- var ml = d.childNodes[1], bl = d.childNodes[2];\r
- bw.appendChild(ml);\r
- bw.appendChild(bl);\r
-\r
- var mc = bw.firstChild.firstChild.firstChild;\r
- this.createElement('tbar', mc);\r
- this.createElement('body', mc);\r
- this.createElement('bbar', mc);\r
- this.createElement('footer', bw.lastChild.firstChild.firstChild);\r
-\r
- if(!this.footer){\r
- this.bwrap.dom.lastChild.className += ' x-panel-nofooter';\r
- }\r
- }else{\r
- this.createElement('header', d);\r
- this.createElement('bwrap', d);\r
-\r
- // append the mid and bottom frame to the bwrap\r
- var bw = this.bwrap.dom;\r
- this.createElement('tbar', bw);\r
- this.createElement('body', bw);\r
- this.createElement('bbar', bw);\r
- this.createElement('footer', bw);\r
-\r
- if(!this.header){\r
- this.body.addClass(this.bodyCls + '-noheader');\r
- if(this.tbar){\r
- this.tbar.addClass(this.tbarCls + '-noheader');\r
- }\r
- }\r
- }\r
-\r
- if(this.border === false){\r
- this.el.addClass(this.baseCls + '-noborder');\r
- this.body.addClass(this.bodyCls + '-noborder');\r
- if(this.header){\r
- this.header.addClass(this.headerCls + '-noborder');\r
- }\r
- if(this.footer){\r
- this.footer.addClass(this.footerCls + '-noborder');\r
- }\r
- if(this.tbar){\r
- this.tbar.addClass(this.tbarCls + '-noborder');\r
- }\r
- if(this.bbar){\r
- this.bbar.addClass(this.bbarCls + '-noborder');\r
- }\r
- }\r
-\r
- if(this.bodyBorder === false){\r
- this.body.addClass(this.bodyCls + '-noborder');\r
- }\r
-\r
- this.bwrap.enableDisplayMode('block');\r
-\r
- if(this.header){\r
- this.header.unselectable();\r
-\r
- // for tools, we need to wrap any existing header markup\r
- if(this.headerAsText){\r
- this.header.dom.innerHTML =\r
- '<span class="' + this.headerTextCls + '">'+this.header.dom.innerHTML+'</span>';\r
-\r
- if(this.iconCls){\r
- this.setIconClass(this.iconCls);\r
- }\r
- }\r
- }\r
-\r
- if(this.floating){\r
- this.makeFloating(this.floating);\r
- }\r
-\r
- if(this.collapsible){\r
- this.tools = this.tools ? this.tools.slice(0) : [];\r
- if(!this.hideCollapseTool){\r
- this.tools[this.collapseFirst?'unshift':'push']({\r
- id: 'toggle',\r
- handler : this.toggleCollapse,\r
- scope: this\r
- });\r
- }\r
- if(this.titleCollapse && this.header){\r
- this.header.on('click', this.toggleCollapse, this);\r
- this.header.setStyle('cursor', 'pointer');\r
- }\r
- }\r
- if(this.tools){\r
- var ts = this.tools;\r
- this.tools = {};\r
- this.addTool.apply(this, ts);\r
- }else{\r
- this.tools = {};\r
- }\r
-\r
- if(this.buttons && this.buttons.length > 0){\r
- // tables are required to maintain order and for correct IE layout\r
- var tb = this.footer.createChild({cls:'x-panel-btns-ct', cn: {\r
- cls:"x-panel-btns x-panel-btns-"+this.buttonAlign,\r
- html:'<table cellspacing="0"><tbody><tr></tr></tbody></table><div class="x-clear"></div>'\r
- }}, null, true);\r
- var tr = tb.getElementsByTagName('tr')[0];\r
- for(var i = 0, len = this.buttons.length; i < len; i++) {\r
- var b = this.buttons[i];\r
- var td = document.createElement('td');\r
- td.className = 'x-panel-btn-td';\r
- b.render(tr.appendChild(td));\r
- }\r
- }\r
-\r
- if(this.tbar && this.topToolbar){\r
- if(Ext.isArray(this.topToolbar)){\r
- this.topToolbar = new Ext.Toolbar(this.topToolbar);\r
- }\r
- this.topToolbar.render(this.tbar);\r
- this.topToolbar.ownerCt = this;\r
- }\r
- if(this.bbar && this.bottomToolbar){\r
- if(Ext.isArray(this.bottomToolbar)){\r
- this.bottomToolbar = new Ext.Toolbar(this.bottomToolbar);\r
- }\r
- this.bottomToolbar.render(this.bbar);\r
- this.bottomToolbar.ownerCt = this;\r
- }\r
- },\r
-\r
- /**\r
- * Sets the CSS class that provides the icon image for this panel. This method will replace any existing\r
- * icon class if one has already been set.\r
- * @param {String} cls The new CSS class name\r
- */\r
- setIconClass : function(cls){\r
- var old = this.iconCls;\r
- this.iconCls = cls;\r
- if(this.rendered && this.header){\r
- if(this.frame){\r
- this.header.addClass('x-panel-icon');\r
- this.header.replaceClass(old, this.iconCls);\r
- }else{\r
- var hd = this.header.dom;\r
- var img = hd.firstChild && String(hd.firstChild.tagName).toLowerCase() == 'img' ? hd.firstChild : null;\r
- if(img){\r
- Ext.fly(img).replaceClass(old, this.iconCls);\r
- }else{\r
- Ext.DomHelper.insertBefore(hd.firstChild, {\r
- tag:'img', src: Ext.BLANK_IMAGE_URL, cls:'x-panel-inline-icon '+this.iconCls\r
- });\r
- }\r
- }\r
- }\r
- this.fireEvent('iconchange', this, cls, old);\r
- },\r
-\r
- // private\r
- makeFloating : function(cfg){\r
- this.floating = true;\r
- this.el = new Ext.Layer(\r
- typeof cfg == 'object' ? cfg : {\r
- shadow: this.shadow !== undefined ? this.shadow : 'sides',\r
- shadowOffset: this.shadowOffset,\r
- constrain:false,\r
- shim: this.shim === false ? false : undefined\r
- }, this.el\r
- );\r
- },\r
-\r
- /**\r
- * Returns the toolbar from the top (tbar) section of the panel.\r
- * @return {Ext.Toolbar} The toolbar\r
- */\r
- getTopToolbar : function(){\r
- return this.topToolbar;\r
- },\r
-\r
- /**\r
- * Returns the toolbar from the bottom (bbar) section of the panel.\r
- * @return {Ext.Toolbar} The toolbar\r
- */\r
- getBottomToolbar : function(){\r
- return this.bottomToolbar;\r
- },\r
-\r
- /**\r
- * Adds a button to this panel. Note that this method must be called prior to rendering. The preferred\r
- * approach is to add buttons via the {@link #buttons} config.\r
- * @param {String/Object} config A valid {@link Ext.Button} config. A string will become the text for a default\r
- * button config, an object will be treated as a button config object.\r
- * @param {Function} handler The function to be called on button {@link Ext.Button#click}\r
- * @param {Object} scope The scope to use for the button handler function\r
- * @return {Ext.Button} The button that was added\r
- */\r
- addButton : function(config, handler, scope){\r
- var bc = {\r
- handler: handler,\r
- scope: scope,\r
- minWidth: this.minButtonWidth,\r
- hideParent:true\r
- };\r
- if(typeof config == "string"){\r
- bc.text = config;\r
- }else{\r
- Ext.apply(bc, config);\r
- }\r
- var btn = new Ext.Button(bc);\r
- btn.ownerCt = this;\r
- if(!this.buttons){\r
- this.buttons = [];\r
- }\r
- this.buttons.push(btn);\r
- return btn;\r
- },\r
-\r
- // private\r
- addTool : function(){\r
- if(!this[this.toolTarget]) { // no where to render tools!\r
- return;\r
- }\r
- if(!this.toolTemplate){\r
- // initialize the global tool template on first use\r
- var tt = new Ext.Template(\r
- '<div class="x-tool x-tool-{id}"> </div>'\r
- );\r
- tt.disableFormats = true;\r
- tt.compile();\r
- Ext.Panel.prototype.toolTemplate = tt;\r
- }\r
- for(var i = 0, a = arguments, len = a.length; i < len; i++) {\r
- var tc = a[i];\r
- if(!this.tools[tc.id]){\r
- var overCls = 'x-tool-'+tc.id+'-over';\r
- var t = this.toolTemplate.insertFirst((tc.align !== 'left') ? this[this.toolTarget] : this[this.toolTarget].child('span'), tc, true);\r
- this.tools[tc.id] = t;\r
- t.enableDisplayMode('block');\r
- t.on('click', this.createToolHandler(t, tc, overCls, this));\r
- if(tc.on){\r
- t.on(tc.on);\r
- }\r
- if(tc.hidden){\r
- t.hide();\r
- }\r
- if(tc.qtip){\r
- if(typeof tc.qtip == 'object'){\r
- Ext.QuickTips.register(Ext.apply({\r
- target: t.id\r
- }, tc.qtip));\r
- } else {\r
- t.dom.qtip = tc.qtip;\r
- }\r
- }\r
- t.addClassOnOver(overCls);\r
- }\r
- }\r
- },\r
-\r
- // private\r
- onShow : function(){\r
- if(this.floating){\r
- return this.el.show();\r
- }\r
- Ext.Panel.superclass.onShow.call(this);\r
- },\r
-\r
- // private\r
- onHide : function(){\r
- if(this.floating){\r
- return this.el.hide();\r
- }\r
- Ext.Panel.superclass.onHide.call(this);\r
- },\r
-\r
- // private\r
- createToolHandler : function(t, tc, overCls, panel){\r
- return function(e){\r
- t.removeClass(overCls);\r
- e.stopEvent();\r
- if(tc.handler){\r
- tc.handler.call(tc.scope || t, e, t, panel);\r
- }\r
- };\r
- },\r
-\r
- // private\r
- afterRender : function(){\r
- if(this.fromMarkup && this.height === undefined && !this.autoHeight){\r
- this.height = this.el.getHeight();\r
- }\r
- if(this.floating && !this.hidden && !this.initHidden){\r
- this.el.show();\r
- }\r
- if(this.title){\r
- this.setTitle(this.title);\r
- }\r
- this.setAutoScroll();\r
- if(this.html){\r
- this.body.update(typeof this.html == 'object' ?\r
- Ext.DomHelper.markup(this.html) :\r
- this.html);\r
- delete this.html;\r
- }\r
- if(this.contentEl){\r
- var ce = Ext.getDom(this.contentEl);\r
- Ext.fly(ce).removeClass(['x-hidden', 'x-hide-display']);\r
- this.body.dom.appendChild(ce);\r
- }\r
- if(this.collapsed){\r
- this.collapsed = false;\r
- this.collapse(false);\r
- }\r
- Ext.Panel.superclass.afterRender.call(this); // do sizing calcs last\r
- this.initEvents();\r
- },\r
-\r
- // private\r
- setAutoScroll : function(){\r
- if(this.rendered && this.autoScroll){\r
- var el = this.body || this.el;\r
- if(el){\r
- el.setOverflow('auto');\r
- }\r
- }\r
- },\r
-\r
- // private\r
- getKeyMap : function(){\r
- if(!this.keyMap){\r
- this.keyMap = new Ext.KeyMap(this.el, this.keys);\r
- }\r
- return this.keyMap;\r
- },\r
-\r
- // private\r
- initEvents : function(){\r
- if(this.keys){\r
- this.getKeyMap();\r
- }\r
- if(this.draggable){\r
- this.initDraggable();\r
- }\r
- },\r
-\r
- // private\r
- initDraggable : function(){\r
- /**\r
- * <p>If this Panel is configured {@link #draggable}, this property will contain\r
- * an instance of {@link Ext.dd.DragSource} which handles dragging the Panel.</p>\r
- * The developer must provide implementations of the abstract methods of {@link Ext.dd.DragSource}\r
- * in order to supply behaviour for each stage of the drag/drop process. See {@link #draggable}.\r
- * @type Ext.dd.DragSource.\r
- * @property dd\r
- */\r
- this.dd = new Ext.Panel.DD(this, typeof this.draggable == 'boolean' ? null : this.draggable);\r
- },\r
-\r
- // private\r
- beforeEffect : function(){\r
- if(this.floating){\r
- this.el.beforeAction();\r
- }\r
- this.el.addClass('x-panel-animated');\r
- },\r
-\r
- // private\r
- afterEffect : function(){\r
- this.syncShadow();\r
- this.el.removeClass('x-panel-animated');\r
- },\r
-\r
- // private - wraps up an animation param with internal callbacks\r
- createEffect : function(a, cb, scope){\r
- var o = {\r
- scope:scope,\r
- block:true\r
- };\r
- if(a === true){\r
- o.callback = cb;\r
- return o;\r
- }else if(!a.callback){\r
- o.callback = cb;\r
- }else { // wrap it up\r
- o.callback = function(){\r
- cb.call(scope);\r
- Ext.callback(a.callback, a.scope);\r
- };\r
- }\r
- return Ext.applyIf(o, a);\r
- },\r
-\r
- /**\r
- * Collapses the panel body so that it becomes hidden. Fires the {@link #beforecollapse} event which will\r
- * cancel the collapse action if it returns false.\r
- * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the\r
- * {@link #animCollapse} panel config)\r
- * @return {Ext.Panel} this\r
- */\r
- collapse : function(animate){\r
- if(this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforecollapse', this, animate) === false){\r
- return;\r
- }\r
- var doAnim = animate === true || (animate !== false && this.animCollapse);\r
- this.beforeEffect();\r
- this.onCollapse(doAnim, animate);\r
- return this;\r
- },\r
-\r
- // private\r
- onCollapse : function(doAnim, animArg){\r
- if(doAnim){\r
- this[this.collapseEl].slideOut(this.slideAnchor,\r
- Ext.apply(this.createEffect(animArg||true, this.afterCollapse, this),\r
- this.collapseDefaults));\r
- }else{\r
- this[this.collapseEl].hide();\r
- this.afterCollapse();\r
- }\r
- },\r
-\r
- // private\r
- afterCollapse : function(){\r
- this.collapsed = true;\r
- this.el.addClass(this.collapsedCls);\r
- this.afterEffect();\r
- this.fireEvent('collapse', this);\r
- },\r
-\r
- /**\r
- * Expands the panel body so that it becomes visible. Fires the {@link #beforeexpand} event which will\r
- * cancel the expand action if it returns false.\r
- * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the\r
- * {@link #animCollapse} panel config)\r
- * @return {Ext.Panel} this\r
- */\r
- expand : function(animate){\r
- if(!this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforeexpand', this, animate) === false){\r
- return;\r
- }\r
- var doAnim = animate === true || (animate !== false && this.animCollapse);\r
- this.el.removeClass(this.collapsedCls);\r
- this.beforeEffect();\r
- this.onExpand(doAnim, animate);\r
- return this;\r
- },\r
-\r
- // private\r
- onExpand : function(doAnim, animArg){\r
- if(doAnim){\r
- this[this.collapseEl].slideIn(this.slideAnchor,\r
- Ext.apply(this.createEffect(animArg||true, this.afterExpand, this),\r
- this.expandDefaults));\r
- }else{\r
- this[this.collapseEl].show();\r
- this.afterExpand();\r
- }\r
- },\r
-\r
- // private\r
- afterExpand : function(){\r
- this.collapsed = false;\r
- this.afterEffect();\r
- this.fireEvent('expand', this);\r
- },\r
-\r
- /**\r
- * Shortcut for performing an {@link #expand} or {@link #collapse} based on the current state of the panel.\r
- * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the\r
- * {@link #animCollapse} panel config)\r
- * @return {Ext.Panel} this\r
- */\r
- toggleCollapse : function(animate){\r
- this[this.collapsed ? 'expand' : 'collapse'](animate);\r
- return this;\r
- },\r
-\r
- // private\r
- onDisable : function(){\r
- if(this.rendered && this.maskDisabled){\r
- this.el.mask();\r
- }\r
- Ext.Panel.superclass.onDisable.call(this);\r
- },\r
-\r
- // private\r
- onEnable : function(){\r
- if(this.rendered && this.maskDisabled){\r
- this.el.unmask();\r
- }\r
- Ext.Panel.superclass.onEnable.call(this);\r
- },\r
-\r
- // private\r
- onResize : function(w, h){\r
- if(w !== undefined || h !== undefined){\r
- if(!this.collapsed){\r
- if(typeof w == 'number'){\r
- this.body.setWidth(\r
- this.adjustBodyWidth(w - this.getFrameWidth()));\r
- }else if(w == 'auto'){\r
- this.body.setWidth(w);\r
- }\r
-\r
- if(typeof h == 'number'){\r
- this.body.setHeight(\r
- this.adjustBodyHeight(h - this.getFrameHeight()));\r
- }else if(h == 'auto'){\r
- this.body.setHeight(h);\r
- }\r
- \r
- if(this.disabled && this.el._mask){\r
- this.el._mask.setSize(this.el.dom.clientWidth, this.el.getHeight());\r
- }\r
- }else{\r
- this.queuedBodySize = {width: w, height: h};\r
- if(!this.queuedExpand && this.allowQueuedExpand !== false){\r
- this.queuedExpand = true;\r
- this.on('expand', function(){\r
- delete this.queuedExpand;\r
- this.onResize(this.queuedBodySize.width, this.queuedBodySize.height);\r
- this.doLayout();\r
- }, this, {single:true});\r
- }\r
- }\r
- this.fireEvent('bodyresize', this, w, h);\r
- }\r
- this.syncShadow();\r
- },\r
-\r
- // private\r
- adjustBodyHeight : function(h){\r
- return h;\r
- },\r
-\r
- // private\r
- adjustBodyWidth : function(w){\r
- return w;\r
- },\r
-\r
- // private\r
- onPosition : function(){\r
- this.syncShadow();\r
- },\r
-\r
- /**\r
- * Returns the width in pixels of the framing elements of this panel (not including the body width). To\r
- * retrieve the body width see {@link #getInnerWidth}.\r
- * @return {Number} The frame width\r
- */\r
- getFrameWidth : function(){\r
- var w = this.el.getFrameWidth('lr');\r
-\r
- if(this.frame){\r
- var l = this.bwrap.dom.firstChild;\r
- w += (Ext.fly(l).getFrameWidth('l') + Ext.fly(l.firstChild).getFrameWidth('r'));\r
- var mc = this.bwrap.dom.firstChild.firstChild.firstChild;\r
- w += Ext.fly(mc).getFrameWidth('lr');\r
- }\r
- return w;\r
- },\r
-\r
- /**\r
- * Returns the height in pixels of the framing elements of this panel (including any top and bottom bars and\r
- * header and footer elements, but not including the body height). To retrieve the body height see {@link #getInnerHeight}.\r
- * @return {Number} The frame height\r
- */\r
- getFrameHeight : function(){\r
- var h = this.el.getFrameWidth('tb');\r
- h += (this.tbar ? this.tbar.getHeight() : 0) +\r
- (this.bbar ? this.bbar.getHeight() : 0);\r
-\r
- if(this.frame){\r
- var hd = this.el.dom.firstChild;\r
- var ft = this.bwrap.dom.lastChild;\r
- h += (hd.offsetHeight + ft.offsetHeight);\r
- var mc = this.bwrap.dom.firstChild.firstChild.firstChild;\r
- h += Ext.fly(mc).getFrameWidth('tb');\r
- }else{\r
- h += (this.header ? this.header.getHeight() : 0) +\r
- (this.footer ? this.footer.getHeight() : 0);\r
- }\r
- return h;\r
- },\r
-\r
- /**\r
- * Returns the width in pixels of the body element (not including the width of any framing elements).\r
- * For the frame width see {@link #getFrameWidth}.\r
- * @return {Number} The body width\r
- */\r
- getInnerWidth : function(){\r
- return this.getSize().width - this.getFrameWidth();\r
- },\r
-\r
- /**\r
- * Returns the height in pixels of the body element (not including the height of any framing elements).\r
- * For the frame height see {@link #getFrameHeight}.\r
- * @return {Number} The body height\r
- */\r
- getInnerHeight : function(){\r
- return this.getSize().height - this.getFrameHeight();\r
- },\r
-\r
- // private\r
- syncShadow : function(){\r
- if(this.floating){\r
- this.el.sync(true);\r
- }\r
- },\r
-\r
- // private\r
- getLayoutTarget : function(){\r
- return this.body;\r
- },\r
-\r
- /**\r
- * <p>Sets the title text for the panel and optionally the icon class.</p>\r
- * <p>In order to be able to set the title, a header element must have been created\r
- * for the Panel. This is triggered either by configuring the Panel with a non-blank title,\r
- * or configuring it with <tt><b>{@link #header}: true</b></tt>.</p>\r
- * @param {String} title The title text to set\r
- * @param {String} iconCls (optional) iconCls A user-defined CSS class that provides the icon image for this panel\r
- */\r
- setTitle : function(title, iconCls){\r
- this.title = title;\r
- if(this.header && this.headerAsText){\r
- this.header.child('span').update(title);\r
- }\r
- if(iconCls){\r
- this.setIconClass(iconCls);\r
- }\r
- this.fireEvent('titlechange', this, title);\r
- return this;\r
- },\r
-\r
- /**\r
- * Get the {@link Ext.Updater} for this panel. Enables you to perform Ajax updates of this panel's body.\r
- * @return {Ext.Updater} The Updater\r
- */\r
- getUpdater : function(){\r
- return this.body.getUpdater();\r
- },\r
-\r
- /**\r
- * Loads this content panel immediately with content returned from an XHR call.\r
- * @param {Object/String/Function} config A config object containing any of the following options:\r
-<pre><code>\r
-panel.load({\r
- url: "your-url.php",\r
- params: {param1: "foo", param2: "bar"}, // or a URL encoded string\r
- callback: yourFunction,\r
- scope: yourObject, // optional scope for the callback\r
- discardUrl: false,\r
- nocache: false,\r
- text: "Loading...",\r
- timeout: 30,\r
- scripts: false\r
-});\r
-</code></pre>\r
- * The only required property is url. The optional properties nocache, text and scripts\r
- * are shorthand for disableCaching, indicatorText and loadScripts and are used to set their\r
- * associated property on this panel Updater instance.\r
- * @return {Ext.Panel} this\r
- */\r
- load : function(){\r
- var um = this.body.getUpdater();\r
- um.update.apply(um, arguments);\r
- return this;\r
- },\r
-\r
- // private\r
- beforeDestroy : function(){\r
- if(this.header){\r
- this.header.removeAllListeners();\r
- if(this.headerAsText){\r
- Ext.Element.uncache(this.header.child('span'));\r
- }\r
- }\r
- Ext.Element.uncache(\r
- this.header,\r
- this.tbar,\r
- this.bbar,\r
- this.footer,\r
- this.body,\r
- this.bwrap\r
- );\r
- if(this.tools){\r
- for(var k in this.tools){\r
- Ext.destroy(this.tools[k]);\r
- }\r
- }\r
- if(this.buttons){\r
- for(var b in this.buttons){\r
- Ext.destroy(this.buttons[b]);\r
- }\r
- }\r
- Ext.destroy(\r
- this.topToolbar,\r
- this.bottomToolbar\r
- );\r
- Ext.Panel.superclass.beforeDestroy.call(this);\r
- },\r
-\r
- // private\r
- createClasses : function(){\r
- this.headerCls = this.baseCls + '-header';\r
- this.headerTextCls = this.baseCls + '-header-text';\r
- this.bwrapCls = this.baseCls + '-bwrap';\r
- this.tbarCls = this.baseCls + '-tbar';\r
- this.bodyCls = this.baseCls + '-body';\r
- this.bbarCls = this.baseCls + '-bbar';\r
- this.footerCls = this.baseCls + '-footer';\r
- },\r
-\r
- // private\r
- createGhost : function(cls, useShim, appendTo){\r
- var el = document.createElement('div');\r
- el.className = 'x-panel-ghost ' + (cls ? cls : '');\r
- if(this.header){\r
- el.appendChild(this.el.dom.firstChild.cloneNode(true));\r
- }\r
- Ext.fly(el.appendChild(document.createElement('ul'))).setHeight(this.bwrap.getHeight());\r
- el.style.width = this.el.dom.offsetWidth + 'px';;\r
- if(!appendTo){\r
- this.container.dom.appendChild(el);\r
- }else{\r
- Ext.getDom(appendTo).appendChild(el);\r
- }\r
- if(useShim !== false && this.el.useShim !== false){\r
- var layer = new Ext.Layer({shadow:false, useDisplay:true, constrain:false}, el);\r
- layer.show();\r
- return layer;\r
- }else{\r
- return new Ext.Element(el);\r
- }\r
- },\r
-\r
- // private\r
- doAutoLoad : function(){\r
- this.body.load(\r
- typeof this.autoLoad == 'object' ?\r
- this.autoLoad : {url: this.autoLoad});\r
- },\r
- \r
- /**\r
- * Retrieve a tool by id.\r
- * @param {String} id\r
- * @return {Object} tool\r
- */\r
- getTool: function(id) {\r
- return this.tools[id];\r
- }\r
-\r
-/**\r
- * @cfg {String} autoEl @hide\r
- */\r
-});\r
-Ext.reg('panel', Ext.Panel);\r