jqgrid xmlJsonClass.json2xml set tag names

左心房为你撑大大i 提交于 2019-12-25 08:35:53

问题


My question is regarding xml generating question.

How can I change the tag name from "row" to another name ?

Thank's In Advance.


回答1:


It seems me prity simple. You can just modify the code of MyExportToXml to about following

var MyExportToXml = function (grid) {
    var dataFromGrid={gridRow:grid.jqGrid('getGridParam','data')};
    var xmldata='<?xml version="1.0" encoding="utf-8" standalone="yes"?>\n<myRows>\n'+
                xmlJsonClass.json2xml (dataFromGrid, '\t') + '</myRows>';
    alert(xmldata);
};

then you will have <gridRow> elements instead of <row>. See the corresponding demo here.



来源:https://stackoverflow.com/questions/4842360/jqgrid-xmljsonclass-json2xml-set-tag-names

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!