问题
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