I am having trouble making a small flex app work. It's a
tutorial on a blog that was created several years ago. The location
of the blog article is:
http://www.bpurcell.org/blog/index.cfm?mode=entry&entry=1020 The article states: The datagrid in Flex works very well with
flat XML. But what if you have a more complex XML packet that you
need to bind to a DataGrid?
Code I have changed to get things working:
I changed the xmlns from macromedia to adobe and got that
I also added <root> and </root> within the Model
tag to make it work.
I changed columnName in the DatagridColumn tag to dataField
These changes allows the app to compile and run but I get an
error as follows:
private function myLabelFunc(item:Object,
The col parameter is not actually needed in your function but
you need to list it in your function parameters. Also, notice that
you should specify the variable type of item as Object and set the
scope of the function to private or public.
Another change would be to simplify the dataProvider binding
Converting the XML model to an array doesn't seem to be
necessary here, but it will work either way.