Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / examples / grid / property-grid.js
1 /*!
2  * Ext JS Library 3.0.0
3  * Copyright(c) 2006-2009 Ext JS, LLC
4  * licensing@extjs.com
5  * http://www.extjs.com/license
6  */
7 Ext.onReady(function(){\r
8     \r
9     var propsGrid = new Ext.grid.PropertyGrid({\r
10         renderTo: 'prop-grid',\r
11         width: 300,\r
12         autoHeight: true,\r
13         propertyNames: {\r
14             tested: 'QA',\r
15             borderWidth: 'Border Width'\r
16         },\r
17         source: {\r
18             '(name)': 'Properties Grid',\r
19             grouping: false,\r
20             autoFitColumns: true,\r
21             productionQuality: false,\r
22             created: new Date(Date.parse('10/15/2006')),\r
23             tested: false,\r
24             version: 0.01,\r
25             borderWidth: 1\r
26         },\r
27         viewConfig : {\r
28             forceFit: true,\r
29             scrollOffset: 2 // the grid will never have scrollbars\r
30         }\r
31     });\r
32 \r
33     // simulate updating the grid data via a button click\r
34     new Ext.Button({\r
35         renderTo: 'button-container',\r
36         text: 'Update source',\r
37         handler: function(){\r
38             propsGrid.setSource({\r
39                 '(name)': 'Property Grid',\r
40                 grouping: false,\r
41                 autoFitColumns: true,\r
42                 productionQuality: true,\r
43                 created: new Date(),\r
44                 tested: false,\r
45                 version: 0.8,\r
46                 borderWidth: 2\r
47             });\r
48         }\r
49     });\r
50 });