jQuery EasyUI 报错:Cannot read property length of XXX
来源:互联网 发布:centos 7.2 vsftpd 编辑:程序博客网 时间:2024/05/20 14:25
错误信息:
Cannot read property length of undefined Cannot read property length of null
场景描述:
在使用easyui 中数据表格DataGrid时,模拟代码如下:
$('#tt').datagrid({ title:'Frozen Columns', iconCls:'icon-save', width:500, height:250, url:'$!basePath/xxx/xxx', frozenColumns:[[ {field:'itemid',title:'Item ID',width:80}, {field:'productid',title:'Product ID',width:80}, ]], columns:[[ {field:'listprice',title:'List Price',width:80,align:'right'}, {field:'unitcost',title:'Unit Cost',width:80,align:'right'}, {field:'attr1',title:'Attribute',width:100}, {field:'status',title:'Status',width:60} ]] });
注意这一行: url:'$!basePath/xxx/xxx'
,Controller返回给DataGrid是一个JSON,
但不要为null,不要为null,不要为null
当返回为null的时候,浏览器控制台会报一个Cannot read property length of null的错误。
阅读全文
0 0
- jQuery EasyUI 报错:Cannot read property length of XXX
- 解决jquery报错cannot read property 'length' of undefined
- easyui列表查询报错:Cannot read property 'length' of undefined
- easyui列表查询报错:Cannot read property 'length' of undefined
- 日常-关于“Cannot read property 'length' of null”报错
- react native 报错:cannot read property 'length' of undefined
- easyui中datagrid显示数据的时候报Cannot read property 'length' of undefined
- JQUERY提示Cannot read property 'length' of undefined
- js的form(load报错jquery.easyui.min.js:2837 Uncaught TypeError: Cannot read property 'tip' of undefined
- easyui reload方法报Cannot read property 'options' of undefined
- Cannot read property 'length' of undefined
- Cannot read property 'length' of null
- easyui防止重复提交及进度条报错解决: Cannot read property 'onClose' of undefined
- Cannot read property 'xxx' of undefined
- jquery file upload 报错:Cannot read property 'nodeName' of undefined
- jquery file upload 报错:Cannot read property 'fileupload' of undefined
- jquery file upload报错:Cannot read property 'parseMetaData' of undefined
- uploadify 报错jquery.uploadify.min.js:16 Uncaught TypeError: Cannot read property 'queueData' of undef
- 【Android】Retrofit 2.0 的使用
- IPC机制系列之三 Android中的IPC方式 (ContentProvider,Socket)
- H
- openstack判断是否支持numa
- 数据结构|顺序队列的实现(实验3.3)
- jQuery EasyUI 报错:Cannot read property length of XXX
- bzoj 2121 字符串游戏(字符串dp)
- ios 条件编译随笔代码
- 掌握这三“点”,绘制幅相频率特性曲线图 so esay!
- 神经网络之预测共享单车使用情况
- ES6 Generator
- MySQL主从复制与主主复制
- 排序算法之插入排序
- uml学习示例图