Select to view content in your preferred language

Can you add records to a Query's ExecuteLastResult?

402
2
06-02-2010 09:32 AM
BrendanLee
Emerging Contributor
Is it possible to add to the executeLastResult set? I want to perform a query and allow the user to add or remove from the returned set. I also have a datagrid that is bound to the executeLastResult set and want it to update as records are added or deleted.

Can I somehow reference the graphics layer that I am adding and deleting graphics on?

dataProvider="{myGraphicsLayer.graphicProvider}" .... or something?

Any help or suggestions would be greatly appreciated.

Thanks!
Tags (2)
0 Kudos
2 Replies
SiminYou
Deactivated User
I used a ArrayCollection to store the query results, then I could dynamically change records.
0 Kudos
BrendanLee
Emerging Contributor
I got it to work:

<esri:GraphicsLayer id="myGraphicsLayer" graphicRemove="updateGrid()" graphicAdd="updateGrid()"/>

private function updateGrid():void
 {
  // Clear grid
  dg.dataProvider.removeAll();  
  results = new ArrayCollection;
      
  for (var i:int = myGraphicsLayer.numGraphics - 1; i >= 0; i--) 
     {
      var g:Graphic = myGraphicsLayer.getChildAt(i) as Graphic;
      results.addItem({PARCEL:g.attributes.PARCEL, OWNER:g.attributes.OWNER, STRNO:g.attributes.STRNO, STRNAME:g.attributes.STRNAME, STRTYPE:g.attributes.STRTYPE})      
  } 
  lblParCount.text = results.length.toString(); 
  dg.dataProvider=results;                             
 }
0 Kudos