X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/src/grid/property/Property.js diff --git a/src/grid/property/Property.js b/src/grid/property/Property.js new file mode 100644 index 00000000..d8ba5c54 --- /dev/null +++ b/src/grid/property/Property.js @@ -0,0 +1,37 @@ +/** + * @class Ext.grid.property.Property + * A specific {@link Ext.data.Model} type that represents a name/value pair and is made to work with the + * {@link Ext.grid.property.Grid}. Typically, Properties do not need to be created directly as they can be + * created implicitly by simply using the appropriate data configs either via the {@link Ext.grid.property.Grid#source} + * config property or by calling {@link Ext.grid.property.Grid#setSource}. However, if the need arises, these records + * can also be created explicitly as shown below. Example usage: + *
+var rec = new Ext.grid.property.Property({
+ name: 'birthday',
+ value: Ext.Date.parse('17/06/1962', 'd/m/Y')
+});
+// Add record to an already populated grid
+grid.store.addSorted(rec);
+
+ * @constructor
+ * @param {Object} config A data object in the format:
+{
+ name: [name],
+ value: [value]
+}
+ * The specified value's type
+ * will be read automatically by the grid to determine the type of editor to use when displaying it.
+ */
+Ext.define('Ext.grid.property.Property', {
+ extend: 'Ext.data.Model',
+
+ alternateClassName: 'Ext.PropGridProperty',
+
+ fields: [{
+ name: 'name',
+ type: 'string'
+ }, {
+ name: 'value'
+ }],
+ idProperty: 'name'
+});
\ No newline at end of file