开发者

How to create a dynamic xml which populates an advanced data grid in flex air application

Is it possible to create a dynamic xml file which changes in some fields to populate an advanced data grid? I have to display continents, countries, society and its values but i want to change randomly only the value and not all toegether... The client side a开发者_高级运维pplication call the database by an asynchronous httpservice. LCDS, Blaze or similar are not allowed. Thanks in advance


Yes, the application I'm working on right now does just this, but I have to get my data and parse through it to transform it into the proper XML.

My data comes in like this:

<rows>
  <row>
    <data_node attr1="something" attr1="something_else"/>
  </row>
  <row>
    <data_node attr1="something2" attr1="something_else2"/>
  </row>
</rows>

And I loop through it with AS finding attributes that define where things go and create the actual XML I use for the datagrid, putting items in their correct areas.

If you do your XML correctly in the page your HTTP service calls you don't even have to parse through it, use the E4X format on the http service and it will take the XML right off the page as a variable.

Edit per comments below:
This page has all you need: http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_2.html

Basically you need to get your php or cf or whatever page to output your XML, which you should be able to google best methods for that, then your httpService needs to include

resultFormat="e4x"

and your result handler will just need to know how to deal with it. All should be in that link.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜