用了easyui-datagrid,页面报错了,显示Cannot read property 'length' of undefined,
http://localhost:8080/erp02/retail/retailSearch显示json:
{"status":0,"msg":"查询成功","data":[{"Status":false,"OperTime":1504020546000,"DefaultNumber":"LSCK201708290002","TotalPrice":42.0,"CreateTime":1504020579000,"ChangeAmount":42.0,"OperPersonName":"啊哈哈","Remark":""}
页面js:
<script type="text/javascript">
$(function(){
$('#retailTable').datagrid({
url:'/erp02/retail/retailSearch',
queryParams:'',
loadMsg:'Loading...',
singleSelect:true,
fitColumns:true,
columns:[[
{field:'DefaultNumber',title:'单据编号',width:100},
{field:'OperTime',title:'单据日期',width:100},
{field:'OperPersonName',title:'操作员',width:100},
{field:'TotalPrice',title:'金额合计',width:100},
{field:'ChangeAmount',title:'收款',width:100},
{field:'Status',title:'状态',width:100},
{field:'Remark',title:'备注',width:100},
{field:'CreateTime',title:'创建时间',width:100}
]]
});
});
</script>
求问怎么解决,新手刚学
貌似懂了,easyui-datagrid的json格式必须要有rows和
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。