bump
--- In flexcoders@yahoogroups.com, "charliecrystle" <charlie.crys...@...> wrote:
>
> Hi--I populate an ADG from a SQLite database. Works great.
>
> But I when I add a record, I want to repopulate the ADG with the data I just
> added, so I call the query function again, populate the ArrayCollection with
> result.data, and refresh the ADG.
>
> My AC is goalsAC. I tried goalsAC.removeAll(), but that doesn't work
> (reported bug, apparently).
>
> Here's the relevant code--you can see I'm trying anything to clear out the
> arraycollection. Doesn't do the job:
>
> gc.source=null; //gc is the MXML group collection in the ADG
> goalsAC.source=new Array(); //goalsAC is the arraycollection
> goalsAC=null;
> goalsAC=new ArrayCollection(result.data)//result.data is SQLResults
>
> if (result.data != null)
> {var numRows:int = result.data.length;
> for (var i:int = 0; i < numRows; i++)
> {
> var row:Object = goalsAC.source[i];
> goalsAC.addItem(row); //adding rows from the
> }
> }
>
> can anyone help? thanks!
>