So after about 5 hours of playing around with it, and then finally moving it out to a class... until i figured out that i had the wrong case...
man i hate it when I make that mistake. --- Matt Chotin <[EMAIL PROTECTED]> wrote: > Why wouldn't it be currentModel[changedColumnName] = > myItem[changedColumnName]? > > > > Matt > > > > _____ > > From: Jonathan Hirschi [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, April 06, 2005 11:48 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] dynamic assignment? > > > > hey guys, I'm trying to figure out how to do some > dynamic assignement to an object... and I'm not sure > about how to do it... > > basically, I have a datagrid that gets information > from a cfc. This datagrid is editable (several > fields) and I want to track changes on the datagrid > one row at a time, and I want to commit updates when > the selection of the row changes. So what I've done > is > to create an object that has names that match the > columns in the datagrid.. then i copy over changes > each time the column changes. > > ala: > currentModel = new Object; > currentModel.IROW= 0; > currentModel.ICOLUMN= 0; > currentModel.ICOLSPAN= 0; > > function sendUpdate(event:Object,myItem:Object):Void > > { > var changedColumnName:String; > var myCol:Object; > > if (mySelectedIndex != event.itemIndex) { > doUpdate(); > } > //changedColumnName = columnList > event.columnIndex].columnName; // this is the name > of > the column that was edited > // this updates the current model so that it > reflects > the current state of things. > > currentModel[myCol.ColumnName] = > myItem[myCol.ColumnName]; > ^^^^^^^^^^^^ > the line above is where i'm trying to dynamically > map > the fields from the datagrid to the object. the > fields have the same name, but this doesn't seem to > work. > > Anyone have any pointers on how to do it? > > Thanks! > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com <http://mail.yahoo.com> > > > > _____ > > Yahoo! Groups Links > > * To visit your group on the web, go to: > http://groups.yahoo.com/group/flexcoders/ > <http://groups.yahoo.com/group/flexcoders/> > > * To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > > * Your use of Yahoo! Groups is subject to the Yahoo! > <http://docs.yahoo.com/info/terms/> Terms of > Service. > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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/