The id is an artifact of my experimentation. I should of left it out.<br>A cleaner version would be:<br><br> var Store = new GeoExt.data.FeatureStore({<br> fields: [<br> {name: 'stfid', type: 'string'},<br>
{name: 'ch_0209_r_tax_val', type: 'float'}<br> ]<br> });<br> var record = Store.getAt(0);<br> record.set("name","ID");<br><br>in which I get the error message "<span class="objectBox objectBox-errorMessage hasTwisty hasBreakSwitch ">record is undefined"</span>. That may mean that Store.getAt(0) is not working. Although I have not found an error.<br>
<br>I've been looking at Ext JS documentation. That is where I got the idea to use record.set to modify a record. However, the examples I've seen look like:<br><br>var Store = new. Ext.data.Store({<br> [{name: 'stfid', type: 'string'},<br>
{name: 'ch_0209_r_tax_val']<br>}<br><br>There is no fields, like I'm using in GeoExt.data.FeatureStore. The API for FeatureStore does not list fields as a config option. Is it inherited from Ext.data.Store?<br>
<br>In any case I'm unsure how to work with it. <br><br>Thanks<br>Jim<br> <br><div class="gmail_quote">On Wed, Sep 30, 2009 at 9:50 PM, Matt Priour <span dir="ltr"><<a href="mailto:mpriour@kestrelcomputer.com">mpriour@kestrelcomputer.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="padding-right: 10px; padding-left: 10px; padding-top: 15px;" name="Compose message area">
<div><font size="2" face="Arial">You've got a whole lot of things going wrong
there.</font></div>
<div><font size="2" face="Arial">You should really look into the ExtJS docs
regarding DataStores.</font></div>
<div><a title="http://www.extjs.com/deploy/ext-2.2/docs/?class=Ext.data.JsonStore
CTRL + Click to follow link" href="http://www.extjs.com/deploy/ext-2.2/docs/?class=Ext.data.JsonStore" target="_blank">http://www.extjs.com/deploy/ext-2.2/docs/?class=Ext.data.JsonStore</a></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">id is a property of the store, not the field. id
refers to the field whose value will be used as the record's id and used in
functions like getById.</font></div>
<div><font size="2" face="Arial">the function record.set modifies the value found in
the field indicated in the first parameter and changes it to the value indicated
in the second parameter.</font></div>
<div><font size="2" face="Arial">Your use of it fails because you don't have a field
named "name" .</font></div>
<div><font size="2" face="Arial">If you did it would change the value in that field
in the record to the string "id"</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Hope that helps at least point you in the right
direction to begin accomplishing what you are wanting to do.</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Matt Priour</font></div>
<div><font size="2" face="Arial">Kestrel Computer Consulting</font></div>
<div style="font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<div><font face="Arial"></font><font face="Arial"></font><font face="Arial"></font><font face="Arial"></font><font face="Arial"></font><font face="Arial"></font><br></div>
<div style="background: rgb(245, 245, 245) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">
<div><b>From:</b> <a title="jmpmcmanus@gmail.com" href="mailto:jmpmcmanus@gmail.com" target="_blank">James McManus</a> </div>
<div><b>Sent:</b> Wednesday, September 30, 2009 6:08 PM</div>
<div><b>To:</b> <a title="users@geoext.org" href="mailto:users@geoext.org" target="_blank">users@geoext.org</a> </div>
<div><b>Subject:</b> [Users] Modify record in a store</div></div></div><div><div></div><div class="h5">
<div><font size="2" face="Arial"></font><font size="2" face="Arial"></font><font size="2" face="Arial"></font><font size="2" face="Arial"></font><font size="2" face="Arial"></font><font size="2" face="Arial"></font><br></div>
Hi - I would like to
modify a record in a store, I created using GeoExt.data.FeatureStore. The actual
store looks like:<br><br> var store =
new
GeoExt.data.FeatureStore({<br>
fields:
[<br>
{id: new Date().getTime(), name: 'stfid', type:
'string'},<br>
{id: new Date().getTime(), name: 'ch_0209_r_tax_val', type:
'float'}<br>
]<br> });<br><br>I thought I could
modify it by doing the following:<br><br>var record =
store.getAt(0);<br>record.set("name", "id");<br><br>which would change stfid to
id. But that did not work. I think it is because I'm not dealing with the
presents of "fields". I've tried a variety of things without
success. Is there a simple way of doing this?<br><br>Thanks<br>Jim<br><br>
</div></div><p>
</p><hr>
<p></p>_______________________________________________<br>Users mailing
list<br><a href="mailto:Users@geoext.org" target="_blank">Users@geoext.org</a><br><a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
</div>
</blockquote></div><br>