DG1: Has a checkbox as the item renderer, with itemaseditor set to
true.
itemEditEnd is set to call a function, passing in the event. The
listener has this code:
public function processmyGrid1(event:DataGridEvent):void {
trace("ended event");
if(event.dataField=="selected"){
if(mx.controls.CheckBox(myGrid1.editedItemRenderer).selected)
myArrayList.addItem(myGrid1.editedItemRenderer.data);
else
trace(myArrayList.getItemIndex
(myGrid1.editedItemRenderer.data).toString());
}
//myArrayList.itemUpdated(myGrid1.editedItemRenderer.data);
//myArrayList.refresh();
//myGrid2.validateNow();
//myGrid2.invalidateDisplayList();
//myGrid2.invalidateList();
//myPanel.validateDisplayList();
myPanel.invalidateDisplayList();
Elsewhere, I have code along the lines of:
myGrid2.dataprovider = myArrayList;
When the above code executes, the object is added to myGrid2, but
it's not reflected in it until I click. All the commented out
statements are things I've tried, that still don't work. myPanel is
the panel that holds myGrid2.
--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]>
wrote:
>
> How are you adding the row to the second DG's array collection?
>
> What does your renderer code look like?
>
>
>
> ________________________________
>
> From: [email protected]
> [mailto:[EMAIL PROTECTED] On Behalf Of phdcpe01
> Sent: Saturday, August 04, 2007 7:43 PM
> To: [email protected]
> Subject: [flexcomponents] Re: Datagrid Update
>
>
>
> That still didn't do the trick...
> --- In [email protected]
> <mailto:flexcomponents%40yahoogroups.com> , "Alex Harui" <aharui@>
> wrote:
> >
> > I think you want itemUpdated()
> >
> >
> >
> > ________________________________
> >
> > From: [email protected]
> <mailto:flexcomponents%40yahoogroups.com>
> > [mailto:[email protected]
> <mailto:flexcomponents%40yahoogroups.com> ] On Behalf Of phdcpe01
> > Sent: Saturday, August 04, 2007 7:03 PM
> > To: [email protected]
> <mailto:flexcomponents%40yahoogroups.com>
> > Subject: [flexcomponents] Re: Datagrid Update
> >
> >
> >
> > I do call arraycollection.refresh() afterwards. However, the DG
> only
> > updates when you click the panel that contains it, instead of
> > immediately.
> > --- In [email protected]
> <mailto:flexcomponents%40yahoogroups.com>
> > <mailto:flexcomponents%40yahoogroups.com> , "Tracy Spratt"
> <tspratt@>
> >
> > wrote:
> > >
> > > Are you using the ArrayCollection API to update it? This should
> > cause
> > > the DG to update automatically.
> > >
> > > Tracy
> > >
> > > -----Original Message-----
> > > From: [email protected]
> <mailto:flexcomponents%40yahoogroups.com>
> > <mailto:flexcomponents%40yahoogroups.com>
> > > [mailto:[email protected]
> <mailto:flexcomponents%40yahoogroups.com>
> > <mailto:flexcomponents%40yahoogroups.com> ] On Behalf Of phdcpe01
> > > Sent: Saturday, August 04, 2007 2:36 PM
> > > To: [email protected]
> <mailto:flexcomponents%40yahoogroups.com>
> > <mailto:flexcomponents%40yahoogroups.com>
> > > Subject: [flexcomponents] Datagrid Update
> > >
> > > Hello,
> > > I've got two datagrids, myGrid1 and myGrid2. Basically, the
user
> > can
> > > select a row in myGrid1, and it'll show up in myGrid2. I am
using
> > an
> > > arraycollection as the dataprovider for myGrid2. Selecting the
> > checkbox
> > > in myGrid1 properly adds the corresponding row to the
> > arraycollection.
> > > However, this isn't reflected in myGrid2 unless you click on
it,
> or
> > > some other window moves in front of it. How can I make myGrid2
> > update
> > > each time there's a change to the arraycollection?
> > >
> > >
> > >
> > >
> > > Yahoo! Groups Links
> > >
> >
>