前台页面:::
<script>
$(document).ready(function(){
 $("#grid").flexigrid({
                            url:"json.do",
                            dataType:"json",
                            colModel:[
                                {display: 'ID', name : 'id', width : 80, sortable : true, align: 'center'},
                                {display: 'NAME', name : 'name', width : 120, sortable : true, align: 'center'},
                                {display: 'REMARK', name : 're', width : 120, sortable : true, align: 'center'},
                                {display: 'STATUS', name : 'test1', width : 120, sortable : true, align: 'center'}                        
                            ],
                            title:"协议组织管理",
                            width : "800",
                            height : "600"
                        });                
});
</script>
servlet中返回的json:::
PrintWriter out = response.getWriter();

String json="{"; 
  json+="\"id\":\"tiny\","; 
  json+="\"name\":\"123\","; 
  json+="\"re\":\"123\","; 
  json+="\"test1\":\"123\"}"; 
  out.write(json); 

}
?????问题:
前台为什么出不来数据jsonservletflexigrid   问题

解决方案 »

  1.   

    应该再加个方括号吧
    String json="[{"; 
      json+="\"id\":\"tiny\","; 
      json+="\"name\":\"123\","; 
      json+="\"re\":\"123\","; 
      json+="\"test1\":\"123\"}]"; 
      out.write(json); 
      

  2.   

    等待中ing ing  ing  ing   ing
      

  3.   

    String json = "{\"page\":\"1\",\"total\":1,\"rows\":[{\"id\":\"tiny\",\"cell\":{\"id\":\"tiny\",\"name\":\"123\",\"re\":\"123\",\"test1\":\"123\"}}]}";这个东西我也没有用过,刚才下载看了下Demo,数据格式是上面这种,你试下。