代码
jQuery(function(){
          $.ajax({
           url: "/cjTest/worker_list.do",
           type:'post', 
           dataType: "json",
           success: function(data){
             $.each(data.user, function(i) {
                   $("#workerlistTbl").html(data.workerJson);
              });
           }
         }); 
    }); table:<table id="workerlistTbl" style="width:450px;height:auto"
title="Editable DataGrid" iconCls="icon-edit" singleSelect="true"
idField="name" >
<tr>
<th field="name" width="80"  >员工姓名</th>  
<th field="department" width="100" formatter="productFormatter" editor="{type:'combobox',options:{valueField:'department',textField:'name',data:departments,required:true}}">所属部门</th>
<th field="sex" width="80"  formatter="sexeach" editor="{type:'combobox',options:{valueField:'sexid',textField:'sex',data:sexsel,required:true}}" >员工性别</th>                                                                                                                                                                    
<th field="entrydate" width="60" align="center" >入职时间</th>
</tr>
</table>

解决方案 »

  1.   

     <table id="dg" title="实时监测数据" class="easyui-datagrid" style="width:777px;height:460px"  
                url="/SZGW/RTDServlet"  
               toolbar="#toolbar" pagination="true"  
                rownumbers="true" fitColumns="true" singleSelect="true">  
            <thead>  
                <tr>  
                    <th field="rid" width="60">ID</th>  
                    <th field="did" width="60">DID</th>  
                    <th field="value" width="60">Value</th>  
                    <th field="date" width="120">Time</th>  
                    <th field="deviceid" width="60">Deviceid</th>
               
                </tr>  
            </thead>  
        </table>  
    直接url对应就好了
      

  2.   

    谢谢你的 帮忙,我前台这样写的  
                JSONArray jsonArray = JSONArray.fromObject(workerlist);   
                JSONObject jsonObject = new JSONObject();   
                jsonObject.put("workerJson", jsonArray);   
                response.getWriter().write(jsonObject.toString());    
    只写 url  不行吧 ,怎么知道获取的是workerJson?
      

  3.   

    js 方法中返回一个 josn 格式的data