views:

19

answers:

2

Hi All

We have a Datagrid:

    <nross:ScalableDataGrid id="grid" 
dataProvider="{model.practiceJoinRequestThickList.practiceJoinRequestThicks}">

    <nross:columns>
                <ui:DataGridToolTipColumn headerText="ID" dataField="practiceJoinRequest.userId"/>
                <ui:DataGridToolTipColumn headerText="Name" dataField="userName"/>
                <ui:DataGridToolTipColumn headerText="Email" dataField="userEmailAddress"/>
                <ui:DataGridToolTipColumn headerText="Office"/>
                <ui:DataGridToolTipColumn headerText="City" dataField="practice.practiceContactAddresses.address.city"/>            
            </nross:columns>

    </nross:ScalableDataGrid>

where practiceJoinRequestThicks is an ArrayCollection of PracticeJoinRequestThick object.

The PracticeJoinRequestThick has an Practice Object.

Practice has an arraycollection "PracticeContactAddresses" which is an arraycollection of PracticeContactAddress object

and PracticeContactAddress object has Address object which has the field city:String

Now when I try to display the City, it does not work. I would appreciate if someone can help me in this regard.

Thanks

Harish

+1  A: 

If practiceContactAddresses is an ArrayCollection, you need to set which one you are referring to. Something like so: dataField="practice.practiceContactAddresses[0].address.city"

Hope that helps.

Wade Mueller
Thanks for your response Wade...but it's not working :(
Harish
A: 

Ok this works if there is one row on the grid....

<ui:DataGridToolTipColumn headerText="City" labelFunction="showCity" dataField="city"/>

protected function showCity(item:Object, column:DataGridColumn):String
            {
                var contactAddresses:ArrayCollection = new ArrayCollection();
    contactAddresses = item.practice.practiceContactAddresses as ArrayCollection;

    return contactAddresses.getItemAt(0).address.city;

    }

But how do I get it to work for multiple rows on the Grid and show the cities for all the rows?

Thanks

Harish