views:

4211

answers:

8
+1  A: 

Have you added:

<script src="grid/js/jqDnR.js" type="text/javascript">
</script>

Also, your XML is missing the closing

</rows>

tag. Try that!

Christian Payne
Thanks for the input but the </rows> tag didnt display because i forgot to highlight it as code. As for the scripts I have included jqDnR.js.The weird thing is that the grid is displayed but with no data (except for the titles)
Drahcir
A: 

I have tried your code. It works, the only problem I have found is that your xml has one mistake:

the first line must be

<?xml version='1.0' encoding = 'utf-8'?>

instead than

<xml version='1.0' encoding = 'utf-8'?>

dario
Tried it but to no avail
Drahcir
A: 

nrGetjqgridXML.xml is ok,but nrGetjqgridXML.aspx wrong,why

A: 

I have same erro in java/struts , I resolve it, setting a stream of xml, but

public class AtualizarListaAction extends Action {

@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
  HttpServletRequest request, HttpServletResponse response)
  throws Exception {

//use this response.setContentType("text/xml;charset=utf-8");

 response.getWriter().println(" <rows>");
 response.getWriter().println("  <row id='1' >");   
 response.getWriter().println("   <cell>1</cell>");

...

A: 

Have you added?

<table id="list" class="scroll" cellpadding="0" cellspacing="0"></table>
Daniel Moura
A: 

this my problem ,who can help me....the data cannot display in table. <%@page contentType="text/html" pageEncoding="GBK"%> JSP Page jQuery(document).ready(function(){ jQuery("#list").jqGrid({ url:'searchMerchant.do', datatype: 'xml', mtype: 'POST', colNames:['编号','名称', '类型','地址','状态'], colModel :[ {name:'编号', index:'merchantid', width:55}, {name:'名称', index:'merchantname', width:90}, {name:'类型', index:'merchanttype', width:80}, {name:'地址', index:'addre', width:80,sortable:false}, {name:'状态', index:'status', width:80}

                        ],
                pager: jQuery('#pager'),
                rowNum:10,
                rowList:[10,20,30],
                sortname: 'merchantid',
                sortorder: "desc",
                viewrecords: true,
                imgpath: '../jqgrid3.3.2/themes/basic/images',
                caption: '商户信息'
            });
        });
    </script>
</head>
<body>
    <table id="list" class="scroll"></table>
    <div id="pager" class="scroll" style="text-align:center;"></div>
</body>

A: 

add

response.setContentType("text/xml;charset=utf-8");

it solves IE problem in updating the grid after servlet response

Thank you

I am using the Mvc Framework and I added Response.ContentType = "text/xml;charset=utf-8" and it worked!
Tahir Hassan
A: 

I was running into the same problem. Eventually through trial-and-error, I got it to work by adding:

mtype: 'GET'

as grid option. IE, from your example,

jQuery(document).ready(function(){ 
  jQuery("#list").jqGrid({
        url:'nrGetjqgridXML.aspx',
        datatype: "xml",
        mtype: 'GET',
        ...