How to display DataGrid to XML file?
I have a requirement that when I click on GeneratXML button which i开发者_高级运维s below the DataGrid the Datagrid data is converted in one xml file.
Something like this would do I think - (I don't know what your data is like, its a two sentence question) ;)
private function getDataProviderXML ( dp :ArrayCollection ) :String {
    var full :String = '<root>';
    for each ( var o :Object in dp ){
        full += '<row>';
        for each ( var prop :String in o ){
            full += '<' + prop + '>' + o[prop] + '</' + prop + '>' 
        }
        full += '</row>';
    }
    return full += '</root>'; 
}
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论