enable grammerly in editor
[roojs1] / docs / symbols / Roo.data.Record.json
1 {
2   "name" : "Roo.data.Record",
3   "augments" : [],
4   "desc" : "Instances of this class encapsulate both record <em>definition</em> information, and record\n<em>value</em> information for use in {@link Roo.data.Store} objects, or any code which needs\nto access Records cached in an {@link Roo.data.Store} object.<br>\n<p>\nConstructors for this class are generated by passing an Array of field definition objects to {@link #create}.\nInstances are usually only created by {@link Roo.data.Reader} implementations when processing unformatted data\nobjects.<br>\n<p>\nRecord objects generated by this constructor inherit all the methods of Roo.data.Record listed below.",
5   "isSingleton" : false,
6   "isStatic" : false,
7   "isBuiltin" : false,
8   "memberOf" : "Record",
9   "example" : "",
10   "deprecated" : "",
11   "since" : "",
12   "see" : "",
13   "params" : [
14     {
15       "name" : "data",
16       "type" : "Array",
17       "desc" : "An associative Array of data values keyed by the field name.",
18       "isOptional" : false
19     },
20     {
21       "name" : "id",
22       "type" : "Object",
23       "desc" : "(Optional) The id of the record. This id should be unique, and is used by the\n{@link Roo.data.Store} object which owns the Record to index its collection of Records. If\nnot specified an integer id is generated.",
24       "isOptional" : false
25     }
26   ],
27   "returns" : [],
28   "config" : [],
29   "methods" : [
30     {
31       "name" : "copy",
32       "desc" : "Creates a copy of this record.",
33       "isStatic" : false,
34       "isConstructor" : false,
35       "isPrivate" : false,
36       "memberOf" : "Roo.data.Record",
37       "example" : "",
38       "deprecated" : "",
39       "since" : "",
40       "see" : "",
41       "params" : [
42         {
43           "name" : "id",
44           "type" : "String",
45           "desc" : "(optional) A new record id if you don't want to use this record's id",
46           "isOptional" : false
47         }
48       ],
49       "returns" : [
50         {
51           "name" : "",
52           "type" : "Record",
53           "desc" : ""
54         }
55       ]
56     },
57     {
58       "name" : "commit",
59       "desc" : "Usually called by the {@link Roo.data.Store} which owns the Record.\nCommits all changes made to the Record since either creation, or the last commit operation.\n<p>\nDevelopers should subscribe to the {@link Roo.data.Store#update} event to have their code notified\nof commit operations.",
60       "isStatic" : false,
61       "isConstructor" : false,
62       "isPrivate" : false,
63       "memberOf" : "Roo.data.Record",
64       "example" : "",
65       "deprecated" : "",
66       "since" : "",
67       "see" : "",
68       "params" : [],
69       "returns" : []
70     },
71     {
72       "name" : "get",
73       "desc" : "Get the value of the named field.",
74       "isStatic" : false,
75       "isConstructor" : false,
76       "isPrivate" : false,
77       "memberOf" : "Roo.data.Record",
78       "example" : "",
79       "deprecated" : "",
80       "since" : "",
81       "see" : "",
82       "params" : [
83         {
84           "name" : "name",
85           "type" : "String",
86           "desc" : "The name of the field to get the value of.",
87           "isOptional" : false
88         }
89       ],
90       "returns" : [
91         {
92           "name" : "",
93           "type" : "Object",
94           "desc" : "The value of the field."
95         }
96       ]
97     },
98     {
99       "name" : "set",
100       "desc" : "Set the named field to the specified value.",
101       "isStatic" : false,
102       "isConstructor" : false,
103       "isPrivate" : false,
104       "memberOf" : "Roo.data.Record",
105       "example" : "",
106       "deprecated" : "",
107       "since" : "",
108       "see" : "",
109       "params" : [
110         {
111           "name" : "name",
112           "type" : "String",
113           "desc" : "The name of the field to set.",
114           "isOptional" : false
115         },
116         {
117           "name" : "value",
118           "type" : "Object",
119           "desc" : "The value to set the field to.",
120           "isOptional" : false
121         }
122       ],
123       "returns" : []
124     },
125     {
126       "name" : "reject",
127       "desc" : "Usually called by the {@link Roo.data.Store} which owns the Record.\nRejects all changes made to the Record since either creation, or the last commit operation.\nModified fields are reverted to their original values.\n<p>\nDevelopers should subscribe to the {@link Roo.data.Store#update} event to have their code notified\nof reject operations.",
128       "isStatic" : false,
129       "isConstructor" : false,
130       "isPrivate" : false,
131       "memberOf" : "Roo.data.Record",
132       "example" : "",
133       "deprecated" : "",
134       "since" : "",
135       "see" : "",
136       "params" : [],
137       "returns" : []
138     },
139     {
140       "name" : "create",
141       "desc" : "Generate a constructor for a specific record layout.",
142       "isStatic" : true,
143       "isConstructor" : false,
144       "isPrivate" : false,
145       "memberOf" : "Roo.data.Record",
146       "example" : "",
147       "deprecated" : "",
148       "since" : "",
149       "see" : "",
150       "params" : [
151         {
152           "name" : "o",
153           "type" : "Array",
154           "desc" : "An Array of field definition objects which specify field names, and optionally,\ndata types, and a mapping for an {@link Roo.data.Reader} to extract the field's value from a data object.\nEach field definition object may contain the following properties: <ul>\n<li><b>name</b> : String<p style=\"margin-left:1em\">The name by which the field is referenced within the Record. This is referenced by,\nfor example the <em>dataIndex</em> property in column definition objects passed to {@link Roo.grid.ColumnModel}</p></li>\n<li><b>mapping</b> : String<p style=\"margin-left:1em\">(Optional) A path specification for use by the {@link Roo.data.Reader} implementation\nthat is creating the Record to access the data value from the data object. If an {@link Roo.data.JsonReader}\nis being used, then this is a string containing the javascript expression to reference the data relative to \nthe record item's root. If an {@link Roo.data.XmlReader} is being used, this is an {@link Roo.DomQuery} path\nto the data item relative to the record element. If the mapping expression is the same as the field name,\nthis may be omitted.</p></li>\n<li><b>type</b> : String<p style=\"margin-left:1em\">(Optional) The data type for conversion to displayable value. Possible values are\n<ul><li>auto (Default, implies no conversion)</li>\n<li>string</li>\n<li>int</li>\n<li>float</li>\n<li>boolean</li>\n<li>date</li></ul></p></li>\n<li><b>sortType</b> : Mixed<p style=\"margin-left:1em\">(Optional) A member of {@link Roo.data.SortTypes}.</p></li>\n<li><b>sortDir</b> : String<p style=\"margin-left:1em\">(Optional) Initial direction to sort. \"ASC\" or \"DESC\"</p></li>\n<li><b>convert</b> : Function<p style=\"margin-left:1em\">(Optional) A function which converts the value provided\nby the Reader into an object that will be stored in the Record. It is passed the\nfollowing parameters:<ul>\n<li><b>v</b> : Mixed<p style=\"margin-left:1em\">The data value as read by the Reader.</p></li>\n</ul></p></li>\n<li><b>dateFormat</b> : String<p style=\"margin-left:1em\">(Optional) A format String for the Date.parseDate function.</p></li>\n</ul>\n<br>usage:<br><pre><code>\nvar TopicRecord = Roo.data.Record.create(\n    {name: 'title', mapping: 'topic_title'},\n    {name: 'author', mapping: 'username'},\n    {name: 'totalPosts', mapping: 'topic_replies', type: 'int'},\n    {name: 'lastPost', mapping: 'post_time', type: 'date'},\n    {name: 'lastPoster', mapping: 'user2'},\n    {name: 'excerpt', mapping: 'post_text'}\n);\n\nvar myNewRecord = new TopicRecord({\n    title: 'Do my job please',\n    author: 'noobie',\n    totalPosts: 1,\n    lastPost: new Date(),\n    lastPoster: 'Animal',\n    excerpt: 'No way dude!'\n});\nmyStore.add(myNewRecord);\n</code></pre>",
155           "isOptional" : false
156         }
157       ],
158       "returns" : []
159     }
160   ],
161   "events" : []
162 }