Have you added:
<script src="grid/js/jqDnR.js" type="text/javascript">
</script>
Also, your XML is missing the closing
</rows>
tag. Try that!
Have you added:
<script src="grid/js/jqDnR.js" type="text/javascript">
</script>
Also, your XML is missing the closing
</rows>
tag. Try that!
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'?>
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>");
...
Have you added?
<table id="list" class="scroll" cellpadding="0" cellspacing="0"></table>
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>
add
response.setContentType("text/xml;charset=utf-8");
it solves IE problem in updating the grid after servlet response
Thank you