Jquery框架 datagrid绑定不上
public String json() throws IOException
{
goods= gooddao.findAll();
String json ="[" ;
for (int i = 0; i < goods.size(); i++) {
WzGoods goo = goods.get(i);
json += "{'code':'"+goo.getGoodCode()+"',";
json += "'name':'"+goo.getGoodFname()+"',";
if(i+1==goods.size())
json += "'measure':'"+goo.getGoodMeasure()+"'}";
else
json += "'measure':'"+goo.getGoodMeasure()+"'},";
}
json +="]";
try {
jsonResult= JSONArray.fromObject(json).toString();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
return SUCCESS;
}
后台
$('#tt').datagrid({
title:'展示数据',
width:560,
height:250,
url:'wzjson',
columns:[[
{field:'code',title:'编号',width:80,sortable:true},
{field:'name',title:'名字',width:80,sortable:true},
{field:'measure',title:'单位',width:80,sortable:true}]]
, pagination:true,rownumbers:true });
}
哪里错了???