Your easiest bet for this is to have a cellRenderer send an event out when you leave the cell and update the dataprovider accordingly in a function which will update the datagrid. If you’re unlucky like me, I had to have selectable=false and it was giving me a headache trying to figure this out (knowing which row I was on) – but I got the final answer after a long list of emails.

Things to note first about this:
-my cell renderer had to have implements="mx.controls.listclasses.IDropInListItemRenderer" because I need access to listdata
-you can’t get to selectedIndices or anything of the like if your selectable=false, so that’s why I had to use the vPosition
-the idea is you bubble an event out from the cell you’re editing, find out what row it is (and column in your case) and change the dataprovider.

Here’s the code for finding the row: (resultsDG is my datagrid, the stuff inside the brackets is the row position and compare is my column)

resultsDG.dataProvider[e.target.parent.listData.owner.vPosition+e.target.parent.listData.rowIndex-1].compare

 

Try tackling the extension of the cellrenderer to get the listData and if you got questions I can provide more examples.
_________________________________________

Jonathan Miranda

Flexible Master of the Web

"Try not to become a man of success, but a man of value." - Albert Einstein

HealthGrades: Guiding America to Better Healthcare™

NASDAQ: HGRD

w  (720) 963-3832

c  (707) 761-0868

[EMAIL PROTECTED]

_________________________________________

The message contains confidential and/or legally privileged information and is intended for use only by the indicated addressee.  If you are not the named addressee you should not disseminate, distribute, or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmissions cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed,arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Sreejith Unnikrishnan
Sent: Tuesday, March 14, 2006 11:39 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] [Flex 1.5] Update ColumnData with new data

 

Hi,

 

Need some help here.

 

Assume I have an editable datagrid with 10 columns and 10 rows, all cells initially populated with a value 0.

 

When I enter a value, say 10 in the first column and tab out, I need to update all the succeeding columns with the value 10. And then if I say edit the 3rd column with a different value, the succeeding columns should update with the new value.

 

What would be the most efficient way to achieve this?

 

Maybe I should try to generically find the "newValue" of a cell and then assign it by rowIndex-columnIndex?

 

Thanks

Sree




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




Reply via email to