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