Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / examples / grid / property.js
1 Ext.require([
2     'Ext.button.Button',
3     'Ext.grid.property.Grid'
4 ]);
5
6 Ext.onReady(function(){
7     // simulate updating the grid data via a button click
8     Ext.create('Ext.button.Button', {
9         renderTo: 'button-container',
10         text: 'Update source',
11         handler: function(){
12             propsGrid.setSource({
13                 '(name)': 'Property Grid',
14                 grouping: false,
15                 autoFitColumns: true,
16                 productionQuality: true,
17                 created: new Date(),
18                 tested: false,
19                 version: 0.8,
20                 borderWidth: 2
21             });
22         }
23     });
24     
25     var propsGrid = Ext.create('Ext.grid.property.Grid', {
26         width: 300,
27         renderTo: 'grid-container',
28         propertyNames: {
29             tested: 'QA',
30             borderWidth: 'Border Width'
31         },
32         source: {
33             "(name)": "Properties Grid",
34             "grouping": false,
35             "autoFitColumns": true,
36             "productionQuality": false,
37             "created": Ext.Date.parse('10/15/2006', 'm/d/Y'),
38             "tested": false,
39             "version": 0.01,
40             "borderWidth": 1
41         }
42     });
43 });