开发者社区> 问答> 正文

新手,求问Cannot read property 'length' of un?400报错

用了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>

求问怎么解决,新手刚学 

展开
收起
爱吃鱼的程序员 2020-06-08 10:34:03 534 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    貌似懂了,easyui-datagrid的json格式必须要有rows和 

    2020-06-08 10:34:19
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载