jqgrid xmlJsonClass.json2xml设置标签名称 [英] jqgrid xmlJsonClass.json2xml set tag names
本文介绍了jqgrid xmlJsonClass.json2xml设置标签名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的问题是关于 xml生成 问题.
My question is regarding xml generating question.
如何将标签名称从行"更改为另一个名称?
How can I change the tag name from "row" to another name ?
感谢提前.
推荐答案
看来我很简单.您可以将MyExportToXml
的代码修改为大约
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);
};
然后您将具有<gridRow>
元素,而不是<row>
.请在此处查看相应的演示.
then you will have <gridRow>
elements instead of <row>
. See the corresponding demo here.
这篇关于jqgrid xmlJsonClass.json2xml设置标签名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文