You don't want to look at the grid, you want to look at the data.  My
suggestion would be to pull the complex calculations out of the label
functions and put them in seperate functions; that are called by the
label functions.  That way ou can re-use the calculations where needed,
and not worry about duplicating code.

-TH

--- In [email protected], "Sefi Ninio" <[EMAIL PROTECTED]> wrote:
>
> Bump...
>
> Anyone? I'd appreciate any input or pointers to links...
>
> Thakns,
> Sefi
>
> On Fri, Aug 22, 2008 at 9:34 AM, Sefi Ninio [EMAIL PROTECTED] wrote:
>
> > Hi Tracy,
> >
> > I know I get the Item, and that's what I currently use.
> > The problem is (and I probably should have mentioned it), that the
other
> > columns labelFunctions make a complex calculation themselves, and I
am
> > reluctant to do it again in the third column labelFunction if
there's a way
> > to get to the already calculated values within the DataGrid.
> >
> > I also thought of keeping the calculation results in an external
map, but
> > there must be a simpler solution...
> > I can't believe there is no way to get from the DataGridColumn to
the grid
> > itself.
> >
> > Sefi
> >
> >
> > On Fri, Aug 22, 2008 at 2:53 AM, Tracy Spratt [EMAIL PROTECTED]:
> >
> >> labelFunction gets two arguments. One is a reference to the
*entire*
> >> dataProvider item, the other to the dataGridColumn. Since you have
a
> >> reference to the whole item, you can easily build your return
string.
> >>
> >>
> >>
> >> Tracy
> >>
> >>
> >> ------------------------------
> >>
> >> *From:* [email protected]
[mailto:[EMAIL PROTECTED] *On
> >> Behalf Of *Sefi Ninio
> >> *Sent:* Thursday, August 21, 2008 4:15 PM
> >> *To:* [email protected]
> >> *Subject:* [flexcoders] DataGridColumn trouble...
> >>
> >>
> >>
> >> Hi.
> >>
> >> I have a DataGrid, and a few DataGridColumns in it.
> >> One of them has a labelFunction, that should return a value that
depends
> >> on the values of two of the other columns.
> >>
> >> example:
> >> | name | start | end | diff |
> >> | xxx | 5 | 7 | 2 |
> >> | yyy | 10 | 100 | 90 |
> >>
> >> etc...
> >>
> >> I can't find a way to get a reference to the DataGrid or the other
> >> DataGridColumns inside it from the labelFunction - using it's
DataGridColumn
> >> argument...
> >>
> >> Any help would be greatly appreciated..
> >>
> >> Sefi
> >>
> >>
> >>
> >
> >
>



Reply via email to