Jqrid generates xml from grid data

I have been trying for several hours to generate an xml string from my grid data when the column names are tag names and the contents of the grid are inside them. my grid is initialized using xmlReader. I tried using:

var dataFromGrid = {row: grid.jqGrid ('getGridParam', 'data')}; var xmldata = xmlJsonClass.json2xml (dataFromGrid, '\ t'); Alert (XMLDATA)

but it did not work for me. How can this be done? it is better not to use json if possible. Thanks in advance.

Update:

This is my code: I am using datatype xml.

Query("#signatory2_payment").jqGrid({
                url:'loadgrid.jsp?type=3',
                datatype: "xml",
                direction:"rtl",
                height: '100%',
                width: '100%',
                colNames:['group_order','claim','beneficiary_description','insurance_code_description'],
                colModel:[
                    {name:'group_order',xmlmap:'group_order', width:80, align:"right",sorttype:"int"},
                    {name:'claim',xmlmap:'claim', width:70, align:"right",sorttype:"int"},
                    {name:'beneficiary_description',xmlmap:'beneficiary_description', width:120, align:"right",sorttype:"string"},
                    {name:'insurance_code_description',xmlmap:'insurance_code_description', width:120, align:"right",sorttype:"string"}},
                ],
                xmlReader: {
                      root:"payments",
                      row:"payment",
                      page:"payments>page",
                      total:"payments>total",
                      records:"payments>records",
                      repeatitems:false
                  },
                multiselect: false,
                autowidth: true,
                forceFit: false,
                shrinkToFit: false,
                caption: " xxxxxx "
            });

If I understand correctly, will it only work on local data? What is the solution for data that is not local? Thanks again.

0
1

. , , .

: , jqGrid . data (, datatype:"local", datatype:"xmlstring" loadonce:true , datatype datatype:"local" , , .

0

Source: https://habr.com/ru/post/1788298/


All Articles