2dc9847ac71ce17347951c72d88e4b5d8f5e9987
[roojs1] / docs / symbols / Roo.data.Record.json
1 {
2   "name" : "Roo.data.Record",
3   "augments" : [],
4   "childClasses" : {  },
5   "tree_children" : [],
6   "tree_parent" : [],
7   "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.",
8   "isSingleton" : false,
9   "isStatic" : false,
10   "isBuiltin" : false,
11   "isAbstract" : false,
12   "isBuilderTop" : false,
13   "memberOf" : "Record",
14   "example" : "",
15   "deprecated" : "",
16   "since" : "",
17   "see" : "",
18   "params" : [
19     {
20       "name" : "data",
21       "type" : "Array",
22       "desc" : "An associative Array of data values keyed by the field name.",
23       "isOptional" : false
24     },
25     {
26       "name" : "id",
27       "type" : "Object",
28       "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.",
29       "isOptional" : false
30     }
31   ],
32   "returns" : [],
33   "throws" : "",
34   "requires" : "",
35   "config" : [],
36   "methods" : [
37     {
38       "name" : "copy",
39       "type" : "function",
40       "desc" : "Creates a copy of this record.",
41       "sig" : "(id)",
42       "static" : false,
43       "memberOf" : "",
44       "isStatic" : false,
45       "isConstructor" : false,
46       "isPrivate" : false,
47       "example" : "",
48       "deprecated" : "",
49       "since" : "",
50       "see" : "",
51       "exceptions" : "",
52       "requires" : "",
53       "params" : [
54         {
55           "name" : "id",
56           "type" : "String",
57           "desc" : "(optional) A new record id if you don't want to use this record's id",
58           "isOptional" : false
59         }
60       ],
61       "returns" : [
62         {
63           "name" : "",
64           "type" : "Record",
65           "desc" : ""
66         }
67       ]
68     },
69     {
70       "name" : "commit",
71       "type" : "function",
72       "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.",
73       "sig" : "()\n{\n\n}",
74       "static" : false,
75       "memberOf" : "",
76       "isStatic" : false,
77       "isConstructor" : false,
78       "isPrivate" : false,
79       "example" : "",
80       "deprecated" : "",
81       "since" : "",
82       "see" : "",
83       "exceptions" : "",
84       "requires" : "",
85       "params" : [],
86       "returns" : []
87     },
88     {
89       "name" : "get",
90       "type" : "function",
91       "desc" : "Get the value of the named field.",
92       "sig" : "(name)",
93       "static" : false,
94       "memberOf" : "",
95       "isStatic" : false,
96       "isConstructor" : false,
97       "isPrivate" : false,
98       "example" : "",
99       "deprecated" : "",
100       "since" : "",
101       "see" : "",
102       "exceptions" : "",
103       "requires" : "",
104       "params" : [
105         {
106           "name" : "name",
107           "type" : "String",
108           "desc" : "The name of the field to get the value of.",
109           "isOptional" : false
110         }
111       ],
112       "returns" : [
113         {
114           "name" : "",
115           "type" : "Object",
116           "desc" : "The value of the field."
117         }
118       ]
119     },
120     {
121       "name" : "set",
122       "type" : "function",
123       "desc" : "Set the named field to the specified value.",
124       "sig" : "(name, value)",
125       "static" : false,
126       "memberOf" : "",
127       "isStatic" : false,
128       "isConstructor" : false,
129       "isPrivate" : false,
130       "example" : "",
131       "deprecated" : "",
132       "since" : "",
133       "see" : "",
134       "exceptions" : "",
135       "requires" : "",
136       "params" : [
137         {
138           "name" : "name",
139           "type" : "String",
140           "desc" : "The name of the field to set.",
141           "isOptional" : false
142         },
143         {
144           "name" : "value",
145           "type" : "Object",
146           "desc" : "The value to set the field to.",
147           "isOptional" : false
148         }
149       ],
150       "returns" : []
151     },
152     {
153       "name" : "reject",
154       "type" : "function",
155       "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.",
156       "sig" : "()\n{\n\n}",
157       "static" : false,
158       "memberOf" : "",
159       "isStatic" : false,
160       "isConstructor" : false,
161       "isPrivate" : false,
162       "example" : "",
163       "deprecated" : "",
164       "since" : "",
165       "see" : "",
166       "exceptions" : "",
167       "requires" : "",
168       "params" : [],
169       "returns" : []
170     },
171     {
172       "name" : "create",
173       "type" : "function",
174       "desc" : "Generate a constructor for a specific record layout.",
175       "sig" : "(o)",
176       "static" : true,
177       "memberOf" : "",
178       "isStatic" : true,
179       "isConstructor" : false,
180       "isPrivate" : false,
181       "example" : "",
182       "deprecated" : "",
183       "since" : "",
184       "see" : "",
185       "exceptions" : "",
186       "requires" : "",
187       "params" : [
188         {
189           "name" : "o",
190           "type" : "Array",
191           "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>",
192           "isOptional" : false
193         }
194       ],
195       "returns" : []
196     }
197   ],
198   "events" : []
199 }