Hi r0main,

I've just realised that you don't need to set the columnName to 0,1,2 etc on
the individual columns. Instead of getDataLabel(), use
getCellIndex().columnIndex - it'll do the same thing.

Cheers,

Ali 


--
Alistair McLeod
Development Director
iteration::two
 
[EMAIL PROTECTED]
Office: +44 (0)131 338 6108
 
This e-mail and any associated attachments transmitted with it may contain
confidential information and must not be copied, or disclosed, or used by
anyone other than the intended recipient(s). If you are not the intended
recipient(s) please destroy this e-mail, and any copies of it, immediately.
 
Please also note that while software systems have been used to try to ensure
that this e-mail has been swept for viruses, iteration::two do not accept
responsibility for any damage or loss caused in respect of any viruses
transmitted by the e-mail. Please ensure your own checks are carried out
before any attachments are opened.

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of r0main
Sent: 10 August 2005 12:26
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Multiples ComboBox Cell Renderers ?

Thanks Ali,
that's a good idea, simple... I'll still investigate my second option for
few minutes then I'll use your solution :-).

Ciao, r0main

--- In flexcoders@yahoogroups.com, "Alistair McLeod" <[EMAIL PROTECTED]> wrote:
> Hi r0main,
> 
>  
> 
> There's a 3rd way, and it's what I've done in the past...
> 
>  
> 
> What you do is have a single data provider, but each element in the 
> data provider is itself an array of whatever you want. Lets keep it as 
> simple strings for now, but you can use objects.
> 
>  
> 
> So, your data provider could be something like the following array:
> 
>  
> 
> [ [ "Row0Column0", "Row0Column1", "Row0Column2" ]
> 
>   [ "Row1Column0", "Row1Column1", "Row1Column2" ]
> 
>   [ "Row2Column0", "Row2Column1", "Row2Column2" ] ]
> 
>  
> 
>  
> 
> Then, on each datagrid column, you set the columnName to a column
index, ie.
> 0, 1, and 2. This is what is returned by getDataLabel() in your
custom cell
> renderer, as you'll see below.
> 
>  
> 
> In your custom cell renderer setValue, do something like this:
> 
>  
> 
> public function setValue( str : String, item : Object, selection :
String )
> {
> 
>    ...
> 
>    var text : String = String( item[ getDataLabel() ] );
> 
>    ...
> 
> }
> 
>  
> 
> text will thereafter hold Row0Column0 etc.
> 
>  
> 
> This is typed from memory, so may not be exact, but it should get
you there.
> 
>  
> 
> Cheers,
> 
>  
> 
> Ali
> 
>  
> 
> --
> 
> Alistair McLeod
> 
> Development Director
> 
> iteration::two
> 
>  
> 
> [EMAIL PROTECTED]
> 
> Office: +44 (0)131 338 6108
> 
>  
> 
> This e-mail and any associated attachments transmitted with it may
contain
> confidential information and must not be copied, or disclosed, or
used by
> anyone other than the intended recipient(s). If you are not the 
> intended
> recipient(s) please destroy this e-mail, and any copies of it,
immediately.
> 
>  
> 
> Please also note that while software systems have been used to try
to ensure
> that this e-mail has been swept for viruses, iteration::two do not
accept
> responsibility for any damage or loss caused in respect of any viruses 
> transmitted by the e-mail. Please ensure your own checks are carried 
> out before any attachments are opened.
> 
> -----Original Message-----
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
> On Behalf Of r0main
> Sent: 10 August 2005 09:05
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Multiples ComboBox Cell Renderers ?
> 
>  
> 
> Hi flexcoders,
> 
> in a single DataGrid I need to use in 3 columns 3 "instances" of
> 
> ComboBox-based CellRenderers, that is 100% same functionnalities,
> 
> except from the ComboBox's data provider [different lists]. Yet I was
> 
> using a static dataProvider in my cellRenderer class, but I can't with
> 
> 3 ComboBox having different content being in the same screen.
> 
>  
> 
> Option 1: I do 3 different ComboBoxCellRenderer classes
> 
> [ComboBoxCellRenderer1, ComboBoxCellRenderer2, ComboBoxCellRenderer3],
> 
> which is what I try to avoid
> 
>  
> 
> Option 2: I find a suitable way to define at DataGridColumn-level the
> 
> dataProvider to us for ComboBoxcellRenderers of this column, so each
> 
> column can have its own dataProvider to fill ComboBoxes. And a
> 
> suitable way to get those dataProvider from inside the CellRenderer...
> 
>  
> 
> Anyone having some Option 2 code sample ? Thanks a lot !!!
> 
>  
> 
> r0main
> 
>  
> 
>  
> 
>  
> 
>  
> 
> ------------------------ Yahoo! Groups Sponsor 
> --------------------~-->
> 
> <font face=arial size=-1><a
>
href="http://us.ard.yahoo.com/SIG=12hc57p3q/M=362329.6886308.7839368.1510227
>
/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123668296/A=2894321/R=0/SIG=11dvsfulr
> /*http://youthnoise.com/page.php?page_id=1992
> 
> ">Fair play? Video games influencing politics. Click and talk 
> back!</a>.</font>
> 
> --------------------------------------------------------------------~-
> >
> 
>  
> 
> --
> 
> 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
> 
>  
> 
>     http://groups.yahoo.com/group/flexcoders/
> 
>  
> 
>     [EMAIL PROTECTED]
> 
>  
> 
>     http://docs.yahoo.com/info/terms/




------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12hrp9hge/M=362335.6886445.7839731.1510227
/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123680348/A=2894361/R=0/SIG=13jmebhbo
/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO
&cmpgn=GRP&RTP=http://groups.yahoo.com/";>In low income neighborhoods, 84% do
not own computers. At Network for Good, help bridge the Digital
Divide!</a>.</font>
--------------------------------------------------------------------~-> 

--
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



 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hnqhkkj/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123684103/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~-> 

--
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/
 


Reply via email to