Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / docs / source / Property.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-grid-property-Property-method-constructor'><span id='Ext-grid-property-Property'>/**
19 </span></span> * @class Ext.grid.property.Property
20  * A specific {@link Ext.data.Model} type that represents a name/value pair and is made to work with the
21  * {@link Ext.grid.property.Grid}.  Typically, Properties do not need to be created directly as they can be
22  * created implicitly by simply using the appropriate data configs either via the {@link Ext.grid.property.Grid#source}
23  * config property or by calling {@link Ext.grid.property.Grid#setSource}.  However, if the need arises, these records
24  * can also be created explicitly as shown below.  Example usage:
25  * &lt;pre&gt;&lt;code&gt;
26 var rec = new Ext.grid.property.Property({
27     name: 'birthday',
28     value: Ext.Date.parse('17/06/1962', 'd/m/Y')
29 });
30 // Add record to an already populated grid
31 grid.store.addSorted(rec);
32 &lt;/code&gt;&lt;/pre&gt;
33  * @constructor
34  * @param {Object} config A data object in the format:&lt;pre&gt;&lt;code&gt;
35 {
36     name: [name],
37     value: [value]
38 }&lt;/code&gt;&lt;/pre&gt;
39  * The specified value's type
40  * will be read automatically by the grid to determine the type of editor to use when displaying it.
41  */
42 Ext.define('Ext.grid.property.Property', {
43     extend: 'Ext.data.Model',
44
45     alternateClassName: 'Ext.PropGridProperty',
46
47     fields: [{
48         name: 'name',
49         type: 'string'
50     }, {
51         name: 'value'
52     }],
53     idProperty: 'name'
54 });</pre>
55 </body>
56 </html>