Hello, I'm trying to put some File objects into a DataGrid, but I can't find a way to display the File.icon in there.
So far I have this: (ms[x] is a File)
listData.addItem({
filename:ms[x].nativePath.replace(/.*\\/,""),
path:ms[x].nativePath.replace(/\\[^\\]*$/,"\\"),
icon:ms[x].icon.bitmaps[0]
});
and
<mx:DataGrid x="358" y="0" width="429" height="378" dataProvider="{listData}">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="filename"/>
<mx:DataGridColumn headerText="Column 2" dataField="icon">
<mx:itemRenderer>
<fx:Component>
<mx:Image width="32" height="32" source="{data}">
</mx:Image>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="Column 3" dataField="path"/>
</mx:columns>
</mx:DataGrid>
filename and path are displayed correctly, I just can't get the file icon to show.
How can I do that ?