I've got a DataGrid (Flex 1.5) bound to an Array of Objects (custom data classes containing a known number of properties, specified in the columnName attributes of my DataGridColumns). If the Array is populated when the DataGrid is loaded, the items display as expected. If I add a new item to the dataProvider, a new row is added to the DataGrid but it's completely blank. I get the same result if the Array is not populated on load and I add a new item. I can click on the row and my keyUp event will fire, but there's just no data displaying.
Example code follows (thanks in advance for the help):
<mx:DataGrid dataProvider="{ModelLocator.currentDeal.units}">
<mx:columns>
<mx:Array>
<mx:DataGridColumn columnName="unitType" editable="false" headerText="" sortable="false"/>
<mx:DataGridColumn columnName="unitYear" headerText="Year" sortable="false"/>
<mx:DataGridColumn columnName="unitMake" headerText="Make" sortable="false"/>
<mx:DataGridColumn columnName="unitModel" headerText="Model" sortable="false"/>
<mx:DataGridColumn columnName="unitCondition" headerText="New/Used" sortable="false" />
</mx:Array>
</mx:columns>
</mx:DataGrid>
var unitData:UnitVO = new UnitVO( );
/**
* @description Adds unit currently displayed in fields below grid to the current deal
* and re-initializes unitData to take another unit from entry form.
* @usage <code>addButton.click="addUnitToList( )"</code>
*/
function addUnitToList():Void
{
// Add new unit and clear out unitData
ModelLocator.currentDeal.addUnit( unitData );
unitData = new UnitVO( );
}
--
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
- 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.

