屁宁儿
2013-12-18 10:58springmvc将数据传递给easyui中的datagrid时数据库中的数据没有显示
这个list集合中的数据已经测试了,可以取到
@RequestMapping(value="/findCost",method=RequestMethod.POST)
@ResponseBody
public Object findCost(HttpServletRequest request) throws Exception{
List costs= costService.findAll();
return costs;
}
有个一table id是dg,changeme为工程名,其中定义的列名都可以正常显示,但是post请求时报406错误,数据都不显示
$(function () {
$('#dg').datagrid(
{
url :'/changeme/findCost',
method : 'post',
title : '资费列表',
iconCls : 'icon-save',
loadMsg : '数据加载中,请稍后......',
fitColumns : true,
striped : true,
singleSelect : true,
rownumbers : true,
columns : [ [
{
field : 'id',
checkbox : true,
width : 10
},
{
field : 'name',
title : '资费名称',
width : 300,
},
{
field : 'baseDuration',
title : '基本时长',
width : 200,
sortable :true
},
{
field : 'baseCost',
title : '基本费用',
width : 200,
sortable :true
},
{
field : 'unitCost',
title : '单位费用',
width : 200,
sortable :true
},
{
field : 'createTime',
title : '创建时间',
width : 200
},
{
field : 'startTime',
title : '开通时间',
width : 200
},
{
field : 'status',
title : '状态',
width : 200,
formatter : function(value) {
if (value == "0") {
return "开通";
} else if (value=="1"){
return "暂停";
}else{
return null;
}
}
}
] ],
toolbar : [ {
text : '添加',
iconCls : 'icon-add',
handler : function() {
// 跳转到添加页面
$('#content').load('/addCost');
}
}, '-', {
text : '删除',
iconCls : 'icon-remove',
handler : function() {
// 跳转到添加页面
var index = $('#dg input:checkbox').value;
del(index);
}
}, '-', {
text : '修改',
iconCls : 'icon-edit',
handler : function() {
view();
}
}]
} );
} );
- 点赞
- 回答
- 收藏
- 复制链接分享
3条回答
为你推荐
- 淘淘商城运行users.jsp页面出现400错误。
- java
- maven
- tomcat
- eclipse
- java-ee
- 1个回答
- springmvc将数据传递给easyui中的datagrid时数据库中的数据没有显示
- spring
- 0个回答
- spring mvc ajax form 上传附件问题
- spring mvc
- 0个回答
- easyUI获取数据网格的内容后传到后台
- spring
- 封装
- easyui
- 9个回答
- 使用easyui dategrid的时候后台获取18位的数字 数字末尾自动为0
- 数据库
- datagrid
- easyui
- 1个回答