I have made an app where a certain score is given to an area based on parameters. And to give the score to that area a calculation is made and the score has to written into the attribute table of the layer. That way i can edit the symbology of the area based on that score in the attribute table. But all of the ways to edit in the layer seem to update the layer itself. I want to do the edits in the client itself. Therefore no changes are made in the layer and when the page is reloaded the layer is reset. Is there a way to accomplish this?
Guus,
Is it a vary large dataset? If it is not to large then you can create a client side feature layer using a a graphics source. Just use a queryTask to get the layers graphics.
This way it is an isolated client side copy of your layer.
Hi Robert,
Thank you for your response, it is not a big dataset. It's only all the neighborhoods of a municipality. Around 100 features. I'm going to try your idea, thank you.
Hi Robert, it worked perfectly thank you very much. I am now struggling to edit the attribute table of the new layer. When I try to use the applyEdit() method I keep getting the error that the objectID identifier field is missing. But I transferred it to the new layer.
Here is some code, if you can take a look at it that would be amazing:
"p" is an integer that represents a objectid
"Score" is the field of "p" which i'm trying to edit
Thanks in advance
Guus,
Normally you would get the feature (graphic) and update the attribute of Score and add that whole graphic to an array to pass to the updateFeatures method. They way you are attempting will not work (passing a simple object that has an attribute property).