Json取值问题

tly321 2017-03-28 02:17:16
第一次用ssh 的easyUI框架做东西 现在想怎么把json 中的值取出来:

.do 代码
@Permission(menuCode=MenuCode.category, privCode=PrivCode.list)
@Action("getData")
public String getData(){
System.out.println(" getData");
try {
String whereJpql = "1=1";
if (value != null){
System.out.println(value);
whereJpql =whereJpql + " and o.id = '" + value + "'";
System.out.println(whereJpql);
}
if (!StringUtils.isEmpty(name)){
whereJpql =whereJpql + " and o.name like '" + name + "%'";
}
if (!StringUtils.isEmpty(code)){
whereJpql =whereJpql + " and o.code like '" + code + "%'";
}
if (!StringUtils.isEmpty(status)){
int temStatus = NumberUtils.toInt(status,1);
whereJpql = whereJpql + " and o.status = " + temStatus;
}
if (!StringUtils.isEmpty(level)){
int temLevel = NumberUtils.toInt(level,1);
whereJpql = whereJpql + " and o.level = " + temLevel;
}
QueryResult<JcCategory> pages = jcCategoryService.findPage(pageIndex, pageSize, whereJpql, null, order, sort);
putJSONResult(pages);
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
return JSON;
}


jsp
这个是 商品(good)展示页 要匹配分类名称 怎么把分类名称取出来
<script type="text/javascript">

function sou(value)
{
alert(value);

$('#category').combogrid({
url:"../JcCategory/getData.do",
dataType:'json',
queryParams:{
value:value
}
});

}

</script>

<body>

<table id="tb1" class="easyui-datagrid" title="" width="100%" height="100%" fit="true" border="0"
data-options="rownumbers:true,pagination:true,url:'../JcGoods/getData.do',singleSelect:false,method:'post',toolbar:'#toolbar1',sortName:'id',sortOrder:'asc'">
<thead>
<tr>
<th data-options="field:'ck',checkbox:true"></th>
<th data-options="field:'id',hidden:true">id</th>
<th data-options="field:'goodName',width:175,align:'left',sortable:'true'">商品名称</th>


</body>
...全文
109 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

87,993

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧