Interesting but not quite the design issue I have in mind. See http://www.danielpride.com/Vehicles3/Vehicles3.html
(Its still a little crude, basically playing with the tech. Clicking on a row fills in a series of text boxes. if you edit a box, I want to shift the state just like it does now when you click the new button at the top, except now it will go to an edit state. The idea is you can examine a large data record by selecting it from a row of important fields, then edit if you like or just look. Its easy enough to compare the values field by field but in my old language I would have written a very small function with two pointers (new and old) and then just called the same function in each focus out, passing in the two pointers to the current field of the focus event. This has got to be childs play I would think but newbie status prevents it from popping out of my head I guess. Dan Pride --- On Fri, 1/29/10, jamesfin <[email protected]> wrote: From: jamesfin <[email protected]> Subject: [flexcoders] Re: Pointers To: [email protected] Date: Friday, January 29, 2010, 11:51 PM Here's what I've done in the past... // add this in your init code... myDataGrid.addEvent Listener( ListEvent. ITEM_EDIT_ END, editEnd); private function editEnd(evt: DataGridEvent) :void{ // get a reference to the datagrid var grid:DataGrid = evt.target as DataGrid; // get a reference to the name of the property in the // underlying object corresponding to the cell that's being edited var field:String = evt.dataField; // get a reference to the row number (the index in the // dataprovider of the row that's being edited) var row:Number = Number(evt.rowIndex ); // get a reference to the column number of // the cell that's being edited var col:int = evt.columnIndex; if (grid != null){ var oldValue:String = String(grid. dataProvider. getItemAt( row)[field] ); var newValue:String = String(grid. itemEditorInstan ce[grid.columns[ col].editorDataF ield]); var rowData:XML = XML(grid.dataProvid er.getItemAt( row)[0]); // check if the value has changed if (newValue == oldValue){ // nothing has changed... return; } // something has changed... // do something... // you could prevent the change if you want // or do some validation // or just return and the data move on to the dp. } } --- In flexcod...@yahoogro ups.com, Dan Pride <danielpride@ ...> wrote: > > Looking for suggestions on how to approach an issue. > > I want to write a function to compare the current value of a text field with > the value of the field in the selected row of the dataGrid. I want to use the > function as a focus-out handler on every text input. > > Obviously I don't want to rewrite this for each and every field but I did not > see a functional similarity to a pointer in actionscript or did I just miss > it? > > This is for the awesome Flashbuilder 4,... I have a text input for every > field in the value object and want to compare each to the selectedItem for > the dataGrid and kick some stuff if it does not match. > Thanks > Dan Pride >

