[flexcoders] Getting a DataGrid item renderer instance

2006-06-19 Thread flex8it
I have simple datagrid with 2 columns and 2 rows like this:

column 0   column 1
   -
image  textfield
image  textfield

Column 0 contains my ImageRenderer component.
Column 1 contains the DataGrid's default item renderer and editor: 
text, textfield.

First Problem:
How do I identify/get a reference to a particular instance of my 
ImageRenderer from, say, column[0], row[1]?

Second (related) Problem:
How do I get the ImageRender instance that corresponds to the row of 
the textfield that fires an event when edited?

I've been wrestling with this problem for days now, and I just can't 
seem to get a grasp on the communication/eventing infrastructure 
that's probably necessary to pull this off. Please help.

Thanks,
Bruce 






 Yahoo! Groups Sponsor ~-- 
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/nhFolB/TM
~- 

--
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] Getting a DataGrid item renderer instance

2006-06-19 Thread Jeremy Lu




There are many possible ways to approach these two problems, depends on what you want to achive.

A basic approach is : item renderer usually implement several
interfaces, like IListData and a bunch of others, two most important
methods are data() and listData().

If you implement these two methods, there will be an automated-chain
between the item renderer and the unlerlying data, so whenever
the dataprovider changes, new value will be passed into each item
renderer.

In your case, you might not really need to get the reference of the
item renderer by row(index), you just want the image item renderer to
do something accordingly ?

If so, let both of the columns (item renderer) set data back to the
underlying dataprovider then let data() and listData() do the job
should be enough.

Jeremy.
On 6/19/06, flex8it [EMAIL PROTECTED] wrote:









  



I have simple datagrid with 2 columns and 2 rows like this:

column 0   column 1
   -
image  textfield
image  textfield

Column 0 contains my ImageRenderer component.
Column 1 contains the DataGrid's default item renderer and editor: 
text, textfield.

First Problem:
How do I identify/get a reference to a particular instance of my 
ImageRenderer from, say, column[0], row[1]?

Second (related) Problem:
How do I get the ImageRender instance that corresponds to the row of 
the textfield that fires an event when edited?

I've been wrestling with this problem for days now, and I just can't 
seem to get a grasp on the communication/eventing infrastructure 
that's probably necessary to pull this off. Please help.

Thanks,
Bruce 


  















__._,_.___





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

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  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.



  






__,_._,___