开发者

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>'; 
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜