开发者

How to display DataGrid to XML file?

开发者 https://www.devze.com 2023-03-21 02:23 出处:网络
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 k

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

精彩评论

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