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: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of r0main
Sent: 10 August 2005 09:05
To: [email protected]
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="">

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

 



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




SPONSORED LINKS
Computer software testing Macromedia flex Development
Software developer


YAHOO! GROUPS LINKS




Reply via email to