dataField can take only a simple string, not an expression.  This means
the property you want must be a top-level property of the dataprovider
item object.

 

For an xml node, you can use dataField for first level child nodes(text
node of those only) or attributes of the node.

 

To specify an attribute you use @AttributeName.

 

I can't tell from your posting exactly what your dataProvider items are.
Are they the <a> nodes? Or the <span> nodes?  What does your
dataProvider assignment look like?

 

To go deeper into a node structure, you must use a labelFunction() which
lets you have anything your want.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of rmonson_us
Sent: Tuesday, December 18, 2007 4:19 PM
To: [email protected]
Subject: [flexcoders] DataGridColumn dataField cannot select an
attribute of an element. Why?

 

I'm accessing an XML document using HTTPService. I've bound the last
result to a DataGrid and the DataGridColumn to the text value of an
<a> element with no problem. Now I want to bind to an attribute in
the a elemenet (i.e. href), but I can't figure out the syntax to be
used in the dataField property. Here is the XML i'm accessing

<html><body>
<span><a class="Customer"
href="http://localhost:8080/nfjs/customer?id=103
<http://localhost:8080/nfjs/customer?id=103> " >Atelier
graphique</a> <br/></span>
<span><a class="Customer"
href="http://localhost:8080/nfjs/customer?id=112
<http://localhost:8080/nfjs/customer?id=112> " >Signal Gift
Stores</a> <br/></span>
...

I can get the value of the <a> attribute into the first column but I
want to put the href attribute value into the second column. How
should I set the dataField property. I've tried dataField="a.href",
dataField="a/href", dataField="[EMAIL PROTECTED]", dataField="a/@href",
dataField="[EMAIL PROTECTED]" with no success. Is it possible to specify an XML
attribute from the dataField property?

Thanks,

Richard

 

Reply via email to