Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / docs / source / File2.html
1 <!DOCTYPE html>
2 <html>
3 <head>
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; }
10   </style>
11   <script type="text/javascript">
12     function highlight() {
13       document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
14     }
15   </script>
16 </head>
17 <body onload="prettyPrint(); highlight();">
18   <pre class="prettyprint lang-js"><span id='Ext-layout-component-field-File'>/**
19 </span> * @private
20  * @class Ext.layout.component.field.File
21  * @extends Ext.layout.component.field.Field
22  * Layout class for {@link Ext.form.field.File} fields. Adjusts the input field size to accommodate
23  * the file picker trigger button.
24  * @private
25  */
26
27 Ext.define('Ext.layout.component.field.File', {
28     alias: ['layout.filefield'],
29     extend: 'Ext.layout.component.field.Field',
30
31     type: 'filefield',
32
33     sizeBodyContents: function(width, height) {
34         var me = this,
35             owner = me.owner;
36
37         if (!owner.buttonOnly) {
38             // Decrease the field's width by the width of the button and the configured buttonMargin.
39             // Both the text field and the button are floated left in CSS so they'll stack up side by side.
40             me.setElementSize(owner.inputEl, Ext.isNumber(width) ? width - owner.button.getWidth() - owner.buttonMargin : width);
41         }
42     }
43 });</pre>
44 </body>
45 </html>