<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<META content="MSHTML 6.00.6001.18294" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" leftMargin=0
topMargin=0 CanvasTabStop="true" name="Compose message area">
<DIV><FONT face=Arial size=2>Yes, GeoExt.data.FeatureStore inherits fields and
all other configuration attributes, methods, properties, & events of
Ext.data.Store, Ext.data.Reader, and Ext.data.MemoryProxy as well as
GeoExt.data.FeatureReader.</FONT></DIV>
<DIV><FONT face=Arial size=2>The reason "record is undefined" is that the store
doesn't yet contain any data. So how could it return a record if none exist yet?
Also FeatureStores are usually attached to a map layer via the "layer"
configuaration attribute. </FONT></DIV>
<DIV><FONT face=Arial size=2>This layer property is what allows the Feature
Store to automatically include features from a layer.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Matt Priour<BR>Kestrel Computer
Consulting<BR></FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=jmpmcmanus@gmail.com
href="mailto:jmpmcmanus@gmail.com">James McManus</A> </DIV>
<DIV><B>Sent:</B> Wednesday, September 30, 2009 10:36 PM</DIV>
<DIV><B>To:</B> <A title=mpriour@kestrelcomputer.com
href="mailto:mpriour@kestrelcomputer.com">Matt Priour</A> </DIV>
<DIV><B>Cc:</B> <A title=users@geoext.org
href="mailto:users@geoext.org">users@geoext.org</A> </DIV>
<DIV><B>Subject:</B> Re: [Users] Modify record in a store</DIV></DIV></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR></DIV>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="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"
name="Compose message area">
<DIV><FONT face=Arial size=2>You've got a whole lot of things going wrong
there.</FONT></DIV>
<DIV><FONT face=Arial size=2>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 face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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 face=Arial size=2>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 face=Arial size=2>Your use of it fails because you don't have a
field named "name" .</FONT></DIV>
<DIV><FONT face=Arial size=2>If you did it would change the value in that
field in the record to the string "id"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Hope that helps at least point you in the right
direction to begin accomplishing what you are wanting to do.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Matt Priour</FONT></DIV>
<DIV><FONT face=Arial size=2>Kestrel Computer Consulting</FONT></DIV>
<DIV style="FONT: 10pt Tahoma; 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); -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 face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></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></BODY></HTML>