Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / docs / source / property-grid.html
1 <html>\r
2 <head>\r
3   <title>The source code</title>\r
4     <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
5     <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
6 </head>\r
7 <body  onload="prettyPrint();">\r
8     <pre class="prettyprint lang-js">Ext.onReady(function(){\r
9     \r
10     var propsGrid = new Ext.grid.PropertyGrid({\r
11         renderTo: 'prop-grid',\r
12         width: 300,\r
13         autoHeight: true,\r
14         propertyNames: {\r
15             tested: 'QA',\r
16             borderWidth: 'Border Width'\r
17         },\r
18         source: {\r
19             '(name)': 'Properties Grid',\r
20             grouping: false,\r
21             autoFitColumns: true,\r
22             productionQuality: false,\r
23             created: new Date(Date.parse('10/15/2006')),\r
24             tested: false,\r
25             version: 0.01,\r
26             borderWidth: 1\r
27         },\r
28         viewConfig : {\r
29             forceFit: true,\r
30             scrollOffset: 2 // the grid will never have scrollbars\r
31         }\r
32     });\r
33 \r
34     // simulate updating the grid data via a button click\r
35     new Ext.Button({\r
36         renderTo: 'button-container',\r
37         text: 'Update source',\r
38         handler: function(){\r
39             propsGrid.setSource({\r
40                 '(name)': 'Property Grid',\r
41                 grouping: false,\r
42                 autoFitColumns: true,\r
43                 productionQuality: true,\r
44                 created: new Date(),\r
45                 tested: false,\r
46                 version: 0.8,\r
47                 borderWidth: 2\r
48             });\r
49         }\r
50     });\r
51 });</pre>    \r
52 </body>\r
53 </html>