Re: [flexcoders] Re: Flex2 Beta2 - Looping through dataGrid to bold cells

2006-04-14 Thread jeremy lu



hi Ryan, 

the best way I can come with now is :

1. in your item renderer's constructor, listens to "dataChange" event,
whenever list-based comonents redraws itself, the "data" property
inside each item renderer will be called, hence trigger the
"dataChange" event.

2. by listening to "dataChange" event, you can check the value inside
the VO or object passed in, then let item renderer do the job (bold or
un-bold a text or anything else).

there's a well-written chapter in manual about data getter/setter and dataChange event, search for it.

jeremy.

On 4/15/06, Ryan Pieszak <[EMAIL PROTECTED]> wrote:
Actually, I need to bold only certain rows.  So I'll need to go downthis cell renderer path.  Can you explan the "check cell renderer"further?  I'm not sure what that means.  Thanks.--- In 
flexcoders@yahoogroups.com, "Karl Johnson" <[EMAIL PROTECTED]>wrote:>> So you want all data in the grid to be bold? Then you should beable to> just set the style on the grid instead of setting it on each row.
>> As for cell renderers, yes yes and yes. It renders on a cell basisand> can modify the display based on the data returned for that cell.And you> can include pictures if you want to! You can create child objects
of any> type (I assume there are some objects that grid cells do not support> though).>> The best way to start is to pull up the much used check cellrenderer.> It displays a checkbox for each cell and checks/unchecks based on a
> conditional of the data returned for that cell. Once you have thecell> renderer class done, just set the cellRenderer property on your> dataColumn to be your new class.>> |<
>> Karl Johnson> Cynergy Systems, Inc.> http://www.cynergysystems.com> -Original Message-> From: 
flexcoders@yahoogroups.com[mailto:flexcoders@yahoogroups.com] On> Behalf Of Ryan Pieszak> Sent: Friday, April 14, 2006 10:42 AM> To: 
flexcoders@yahoogroups.com> Subject: [flexcoders] Re: Flex2 Beta2 - Looping through dataGrid tobold> cells>> Hey Karl, thanks for the quick response!>> Ideally, I'd like certain rows to be bold when the data is
populated,> but I don't know how to do that.  So, I'd like to bold the cells assoon> as the data is displayed.  I never want the user to see the data inthe> dataGrid without the bold text.
>> I'm really curious about this custom cell renderer.  Can it go tothe> cell level, or just row?  Can I include pictures???  Can all this be> done on a conditional basis (the value of the cell)?
>> I can't find a Beta2 link for it, everything is Beta1, except for> this...>http://livedocs.macromedia.com/labs/1/flex20beta2/wwhelp/wwhimpl/commo
> n/html/wwhelp.htm?context=LiveDocs_Parts&file=0123.html#142625> ...which is clearly no help.  Any links would be greatlyappreciated.>> Thanks.>> --- In 
flexcoders@yahoogroups.com, "Karl Johnson" > wrote:> >> > To set the style to bold, you will most likely want to do> > item.setStyle("fontWeight", "bold"); (I have not tested it
> > specifically on this object type, but that is> what> > it would be on any object that does support it).> >> > When do you need to set rows to bold? Does it always happen as
soon> as> > the dataprovider is set/the grid shows data? Then you should gothe> > custom cell renderer rout. Then you can do anything you want toeach> > cell, including display objects other than strings.
> >> > Hope that helps!> >> > |<> >> > Karl Johnson> > Cynergy Systems, Inc.> > http://www.cynergysystems.com
> >> > -Original Message-> > From: flexcoders@yahoogroups.com> [mailto:flexcoders@yahoogroups.com
] On> > Behalf Of Ryan Pieszak> > Sent: Friday, April 14, 2006 9:32 AM> > To: flexcoders@yahoogroups.com> > Subject: [flexcoders] Flex2 Beta2 - Looping through dataGrid to
bold> > cells> >> > Hello all, if there's a better way to do this, please let meknow.> I'd> > prefer not to loop everytime the grid is refreshed.> >> > So, if I'm trying to bold certain cells based on their value (by
> > looping), these are the problems I'm having...> >> > 1) I can't find a property that holds the total row count of the> grid to> > use as the number to loop through.> >
> > 2) I thought this was the way to bold the text, but I can't get it> to> > work...> >my_Grid.columns.my_Column[row_number].fontWeight="bold";> >> > Thanks guys.
> > Ryan> >> >> >> >> >> >> > --> > Flexcoders Mailing List> > FAQ:> 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> > Search Archives:> > http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > Yahoo! Groups Links>  --> Flexcoders Mailing List> FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> Search Archives:> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links>--Flexcoders Mailing ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/<

RE: [flexcoders] Re: Flex2 Beta2 - Looping through dataGrid to bold cells

2006-04-14 Thread Karl Johnson
So you want all data in the grid to be bold? Then you should be able to
just set the style on the grid instead of setting it on each row. 

As for cell renderers, yes yes and yes. It renders on a cell basis and
can modify the display based on the data returned for that cell. And you
can include pictures if you want to! You can create child objects of any
type (I assume there are some objects that grid cells do not support
though).

The best way to start is to pull up the much used check cell renderer.
It displays a checkbox for each cell and checks/unchecks based on a
conditional of the data returned for that cell. Once you have the cell
renderer class done, just set the cellRenderer property on your
dataColumn to be your new class.

|<

Karl Johnson
Cynergy Systems, Inc.
http://www.cynergysystems.com
-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Ryan Pieszak
Sent: Friday, April 14, 2006 10:42 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Flex2 Beta2 - Looping through dataGrid to bold
cells

Hey Karl, thanks for the quick response!

Ideally, I'd like certain rows to be bold when the data is populated,
but I don't know how to do that.  So, I'd like to bold the cells as soon
as the data is displayed.  I never want the user to see the data in the
dataGrid without the bold text.

I'm really curious about this custom cell renderer.  Can it go to the
cell level, or just row?  Can I include pictures???  Can all this be
done on a conditional basis (the value of the cell)?

I can't find a Beta2 link for it, everything is Beta1, except for
this...
http://livedocs.macromedia.com/labs/1/flex20beta2/wwhelp/wwhimpl/commo
n/html/wwhelp.htm?context=LiveDocs_Parts&file=0123.html#142625
...which is clearly no help.  Any links would be greatly appreciated.

Thanks.

--- In flexcoders@yahoogroups.com, "Karl Johnson" <[EMAIL PROTECTED]>
wrote:
>
> To set the style to bold, you will most likely want to do 
> item.setStyle("fontWeight", "bold"); (I have not tested it 
> specifically on this object type, but that is
what
> it would be on any object that does support it). 
> 
> When do you need to set rows to bold? Does it always happen as soon
as
> the dataprovider is set/the grid shows data? Then you should go the 
> custom cell renderer rout. Then you can do anything you want to each 
> cell, including display objects other than strings.
> 
> Hope that helps!
> 
> |<
> 
> Karl Johnson
> Cynergy Systems, Inc.
> http://www.cynergysystems.com
> 
> -Original Message-
> From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
> Behalf Of Ryan Pieszak
> Sent: Friday, April 14, 2006 9:32 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Flex2 Beta2 - Looping through dataGrid to bold 
> cells
> 
> Hello all, if there's a better way to do this, please let me know.  
I'd
> prefer not to loop everytime the grid is refreshed.
> 
> So, if I'm trying to bold certain cells based on their value (by 
> looping), these are the problems I'm having...
> 
> 1) I can't find a property that holds the total row count of the
grid to
> use as the number to loop through.
> 
> 2) I thought this was the way to bold the text, but I can't get it
to
> work...
>my_Grid.columns.my_Column[row_number].fontWeight="bold";
> 
> Thanks guys.
> Ryan
> 
> 
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links



 





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




RE: [flexcoders] Re: Flex2 Beta2 - Looping through dataGrid to bold cells

2006-04-14 Thread Jason Hawryluk
Yes, a cellrenderer is on the cell level. Yes, you can include any other
component you like (image or otherwise). Yes, it can very easily be done on
a conditional basis.

Bold text, red text, what ever you heart desires. :)

Jason

-Message d'origine-
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] la
part de Ryan Pieszak
Envoyé : vendredi 14 avril 2006 16:42
À : flexcoders@yahoogroups.com
Objet : [flexcoders] Re: Flex2 Beta2 - Looping through dataGrid to bold
cells


Hey Karl, thanks for the quick response!

Ideally, I'd like certain rows to be bold when the data is populated,
but I don't know how to do that.  So, I'd like to bold the cells as
soon as the data is displayed.  I never want the user to see the data
in the dataGrid without the bold text.

I'm really curious about this custom cell renderer.  Can it go to the
cell level, or just row?  Can I include pictures???  Can all this be
done on a conditional basis (the value of the cell)?

I can't find a Beta2 link for it, everything is Beta1, except for
this...
http://livedocs.macromedia.com/labs/1/flex20beta2/wwhelp/wwhimpl/commo
n/html/wwhelp.htm?context=LiveDocs_Parts&file=0123.html#142625
...which is clearly no help.  Any links would be greatly appreciated.

Thanks.

--- In flexcoders@yahoogroups.com, "Karl Johnson" <[EMAIL PROTECTED]>
wrote:
>
> To set the style to bold, you will most likely want to do
> item.setStyle("fontWeight", "bold");
> (I have not tested it specifically on this object type, but that is
what
> it would be on any object that does support it).
>
> When do you need to set rows to bold? Does it always happen as soon
as
> the dataprovider is set/the grid shows data? Then you should go the
> custom cell renderer rout. Then you can do anything you want to each
> cell, including display objects other than strings.
>
> Hope that helps!
>
> |<
>
> Karl Johnson
> Cynergy Systems, Inc.
> http://www.cynergysystems.com
>
> -Original Message-
> From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
> Behalf Of Ryan Pieszak
> Sent: Friday, April 14, 2006 9:32 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Flex2 Beta2 - Looping through dataGrid to bold
> cells
>
> Hello all, if there's a better way to do this, please let me know.
I'd
> prefer not to loop everytime the grid is refreshed.
>
> So, if I'm trying to bold certain cells based on their value (by
> looping), these are the problems I'm having...
>
> 1) I can't find a property that holds the total row count of the
grid to
> use as the number to loop through.
>
> 2) I thought this was the way to bold the text, but I can't get it
to
> work...
>my_Grid.columns.my_Column[row_number].fontWeight="bold";
>
> Thanks guys.
> Ryan
>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS

 Visit your group "flexcoders" on the web.

 To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]

 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/