• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Binding to an ArrayCollection with getItemAt()

Engaged ,
May 08, 2018 May 08, 2018

Copy link to clipboard

Copied

I need to bind the data being displayed in a datagrid to an array contained in an array.

The array of interest is located in AppModel.UserData[0].EmergencyContacts   Where EmergencyContacts holds an array of 1 to n elements.

The structure looks like this:

Array.PNG

The code I'm using for my datagrid looks like this:

<mx:DataGrid id="DG_ContactsGrid" y="8" width="530" height="80" change="EditData()"

dataProvider="{AppModel.UserData.getItemAt(0).EmergencyContacts}" horizontalCenter="0" styleName="DataGrid" >

<mx:columns>

<mx:DataGridColumn headerText="Contact Name" dataField="ContactName" width="110" />

<mx:DataGridColumn headerText="Ph Number" dataField="ContactPhNum" width="80" />

<mx:DataGridColumn headerText="Relationship" dataField="RelationshipType" width="100" />

</mx:columns>

</mx:DataGrid >

The form looks like this:

AFrom.PNG

This code displays the correct values in the datagrid but when I update the data it's not bound to the array.  I can see the contents of the array itself have been updated after the update utility runs but the contents in the datagrid doesn't change.

Any thoughts on why getItemAt() isn't working???   Well other than I'm not using it correctly!!!   😮

Thanks in advance for the insight!!!

Views

230

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines