请教一个easyui datagrid 生产表格的问题。
JSP代码
$(function() {
myDatagrid=$('#dg').datagrid({
url : 'Grup.action',
pageSize : 15,
pageList : [ 15, 20, 25 , 30],
fit : true,
fitColumns : true,
loadMsg : '请稍等,正在加载....',
nowap : true,
border : false,
nowrap : true,
pagination : true, //显示分页
rownumbers : true, //显示行号
striped : false,
fitColumns : true,
singleSelect : true,
striped : true,
toolbar : '#button',
columns : [ [ {
field : 'id',
checkbox : 'true',
align : 'center',
width : 60
},
{
field : 'title',
title : '标题',
align : 'center',
width : 150
}, {
field : 'contet',
title : '内容',
align : 'center',
width : 250
},{
field : 'imagePath',
title : '图片',
align : 'center',
width : 250,
formatter:function(value,row){
var str = "";
if(value=="" || value==null){
str = "<img style=\"height: 80px;width: 150px;\" src=\"../images/zhanwu.jpg\"/>";
}else{
str = "<img style=\"height: 80px;width: 150px;\" src=\""+value+"\"/>";
}
return str;
}
}]]
});
});
有数据时正常,没数据时谷歌浏览器报错
Cannot read property 'length' of null
不太了解easyui的源码 不知道如何改 。