<div xmlns:ext="http://www.extjs.com" class="body-wrap"><h1>Class <a href="source/DataField.html#cls-Ext.data.Field">Ext.data.Field</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.data</td></tr><tr><td class="label">Defined In:</td><td class="hd-info">DataField.js</td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/DataField.html#cls-Ext.data.Field">Field</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr></table><div class="description"><p>This class encapsulates the field definition information specified in the field definition objects
passed to <a href="output/Ext.data.Record.html#Ext.data.Record-create" ext:member="create" ext:cls="Ext.data.Record">Ext.data.Record.create</a>.</p>
<p>Developers do not need to instantiate this class. Instances are created by <a href="output/Ext.data.Record.create.html" ext:cls="Ext.data.Record.create">Ext.data.Record.create</a>
-and cached in the <a href="output/Ext.data.Record.html#Ext.data.Record-fields" ext:member="fields" ext:cls="Ext.data.Record">fields</a> property of the created Record constructor's <b>prototype.</b></p></div><div class="hr"></div><a id="Ext.data.Field-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-allowBlank"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-allowBlank">allowBlank</a></b> : Boolean<div class="mdesc"><div class="short">Used for validating a record, defaults to true.\r
-An empty value here will cause Ext.data.Record.isValid\r
+and cached in the <a href="output/Ext.data.Record.html#Ext.data.Record-fields" ext:member="fields" ext:cls="Ext.data.Record">fields</a> property of the created Record constructor's <b>prototype.</b></p></div><div class="hr"></div><a id="Ext.data.Field-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-allowBlank"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-allowBlank">allowBlank</a></b> : Boolean<div class="mdesc"><div class="short">Used for validating a record, defaults to true.
+An empty value here will cause Ext.data.Record.isValid
to evaluate to...</div><div class="long">Used for validating a <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">record</a>, defaults to <tt>true</tt>.
An empty value here will cause <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">Ext.data.Record</a>.<a href="output/Ext.data.Record.html#Ext.data.Record-isValid" ext:member="isValid" ext:cls="Ext.data.Record">isValid</a>
-to evaluate to <tt>false</tt>.</div></div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-convert"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-convert">convert</a></b> : Function<div class="mdesc"><div class="short">A function which converts the value provided by the Reader into an object that will be stored\r
+to evaluate to <tt>false</tt>.</div></div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-convert"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-convert">convert</a></b> : Function<div class="mdesc"><div class="short">A function which converts the value provided by the Reader into an object that will be stored
in the Record. It is pa...</div><div class="long">A function which converts the value provided by the Reader into an object that will be stored
in the Record. It is passed the following parameters:<div class="mdetail-params"><ul>
<li><b>v</b> : Mixed<div class="sub-desc">The data value as read by the Reader, if undefined will use
name: { first: <em>'Cliff'</em>, last: <em>'Claven'</em> },
city: <em>'Boston'</em>, state: <em>'MA'</em>
}
-];</code></pre></div></div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-dateFormat"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-dateFormat">dateFormat</a></b> : String<div class="mdesc"><div class="short">A format string for the Date.parseDate function, or "timestamp" if the\r
+];</code></pre></div></div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-dateFormat"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-dateFormat">dateFormat</a></b> : String<div class="mdesc"><div class="short">A format string for the Date.parseDate function, or "timestamp" if the
value provided by the Reader is a UNIX timesta...</div><div class="long">A format string for the <a href="output/Date.html#Date-parseDate" ext:member="parseDate" ext:cls="Date">Date.parseDate</a> function, or "timestamp" if the
value provided by the Reader is a UNIX timestamp, or "time" if the value provided by the Reader is a
-javascript millisecond timestamp.</div></div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-defaultValue"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-defaultValue">defaultValue</a></b> : Mixed<div class="mdesc"><div class="short">The default value used when a Record is being created by a Reader\r
+javascript millisecond timestamp.</div></div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-defaultValue"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-defaultValue">defaultValue</a></b> : Mixed<div class="mdesc"><div class="short">The default value used when a Record is being created by a Reader
when the item referenced by the mapping does not ex...</div><div class="long">The default value used <b>when a Record is being created by a <a href="output/Ext.data.Reader.html" ext:cls="Ext.data.Reader">Reader</a></b>
when the item referenced by the <tt><a href="output/Ext.data.Field.html#Ext.data.Field-mapping" ext:member="mapping" ext:cls="Ext.data.Field">mapping</a></tt> does not exist in the data
-object (i.e. undefined). (defaults to "")</div></div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-mapping"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-mapping">mapping</a></b> : String/Number<div class="mdesc"><div class="short">(Optional) A path expression for use by the Ext.data.DataReader implementation\r
+object (i.e. undefined). (defaults to "")</div></div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-mapping"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-mapping">mapping</a></b> : String/Number<div class="mdesc"><div class="short">(Optional) A path expression for use by the Ext.data.DataReader implementation
that is creating the Record to extract...</div><div class="long"><p>(Optional) A path expression for use by the <a href="output/Ext.data.DataReader.html" ext:cls="Ext.data.DataReader">Ext.data.DataReader</a> implementation
that is creating the <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">Record</a> to extract the Field value from the data object.
If the path expression is the same as the field name, the mapping may be omitted.</p>
</ul></div>
<p>If a more complex value extraction strategy is required, then configure the Field with a <a href="output/Ext.data.Field.html#Ext.data.Field-convert" ext:member="convert" ext:cls="Ext.data.Field">convert</a>
function. This is passed the whole row object, and may interrogate it in whatever way is necessary in order to
-return the desired data.</p></div></div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-name"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-name">name</a></b> : String<div class="mdesc"><div class="short">The name by which the field is referenced within the Record. This is referenced by, for example,\r
+return the desired data.</p></div></div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-name"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-name">name</a></b> : String<div class="mdesc"><div class="short">The name by which the field is referenced within the Record. This is referenced by, for example,
the dataIndex proper...</div><div class="long">The name by which the field is referenced within the Record. This is referenced by, for example,
the <tt>dataIndex</tt> property in column definition objects passed to <a href="output/Ext.grid.ColumnModel.html" ext:cls="Ext.grid.ColumnModel">Ext.grid.ColumnModel</a>.
<p>Note: In the simplest case, if no properties other than <tt>name</tt> are required, a field
definition may consist of just a String for the field name.</p></div></div></td><td class="msource">Field</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-sortDir"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-sortDir">sortDir</a></b> : String<div class="mdesc">Initial direction to sort (<tt>"ASC"</tt> or <tt>"DESC"</tt>). Defaults to
-<tt>"ASC"</tt>.</div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-sortType"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-sortType">sortType</a></b> : Function<div class="mdesc"><div class="short">A function which converts a Field's value to a comparable value in order to ensure\r
+<tt>"ASC"</tt>.</div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-sortType"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-sortType">sortType</a></b> : Function<div class="mdesc"><div class="short">A function which converts a Field's value to a comparable value in order to ensure
correct sort ordering. Predefined ...</div><div class="long">A function which converts a Field's value to a comparable value in order to ensure
correct sort ordering. Predefined functions are provided in <a href="output/Ext.data.SortTypes.html" ext:cls="Ext.data.SortTypes">Ext.data.SortTypes</a>. A custom
sort example:<pre><code><i>// current sort after sort we want</i>
<b>case</b> <em>'second'</em>: <b>return</b> 2;
<b>default</b>: <b>return</b> 3;
}
-}</code></pre></div></div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-type"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-type">type</a></b> : String<div class="mdesc"><div class="short">The data type for conversion to displayable value if convert\r
-has not been specified. Possible values are\r
+}</code></pre></div></div></td><td class="msource">Field</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Field-type"></a><b><a href="source/DataField.html#cfg-Ext.data.Field-type">type</a></b> : String<div class="mdesc"><div class="short">The data type for conversion to displayable value if convert
+has not been specified. Possible values are
<div class="...</div><div class="long">The data type for conversion to displayable value if <tt><a href="output/Ext.data.Field.html#Ext.data.Field-convert" ext:member="convert" ext:cls="Ext.data.Field">convert</a></tt>
has not been specified. Possible values are
<div class="mdetail-params"><ul>