Previously I post a discussion on this matter on Flex Adobe forum and still don't understand what needs to be done. So, I'll try my luck again on stackoverflow.
I'm using drag and drop data binding functionality in flash builder 4 on a data-grid. However, the data I need to show need to be query from another object.
<mx:DataGrid id="dataGrid2" dataProvider="{getMajorDetailsResult.lastResult}">
<mx:columns>
<mx:DataGridColumn headerText="Category Name" />
<mx:DataGridColumn headerText="Require Credits" dataField="requireCredits" resizable="false" width="40"/>
</mx:columns>
</mx:DataGrid>
In this datagrid I bind it with an object MACL which has
- ID
- CAT_ID
- requireCredits
However, I would like to display CategoryName in the first column but categoryName is in another Object (category)
- CAT_ID
- CategoryName
In this case what should I do?
I did this so that if in the future Category Name needs to be rename. I can just rename the one in category table.
Someone there told me to use data model. I guess I should try to cast the object retrieved from callresponder into my self defined class object then set this class to my datagrid's dataprovider? Is that what should be done
Sample code is highly appreciated.
Thank you