- 注册时间
- 2016-10-18
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 积分
- 85
- 精华
- 0
- 帖子
- 19
|
请求我是利用ajax进行的,然后设置咱们表格的data属性,
这是定义的table
<div id='datagrid1' class='mini-datagrid' style='width:100%;height:280px;margin:auto;'>
<div property='columns'>
<div type='indexcolumn' ></div>
<div field='doctoraddress' width='120' headerAlign='center' allowSort='true'>员工帐号</div>
<div field='doctorage' width='120' headerAlign='center' allowSort='true'>姓名</div>
<div field='doctorgender' width='100' align='center' headerAlign='center'>性别</div>
<div field='doctorname' width='100' allowSort='true'>薪资</div>
<div field='doctorphone' width='100' allowSort='true'>年龄</div>
<div field='doctorphoto' width='100' headerAlign='center' allowSort='true'>创建日期</div>
</div>
</div>
这是ajax请求:
$.ajax({
url : "paitentAction/findmyappointment.do",
type : "post",
dataType:"json",
success:function(data){
alert(data.jsonarray);
$("#datagrid1").arrt(data,data.jsonarray);
mini.parse();
var grid = mini.get("datagrid1");
grid.load();
}
});
这是ajax请求返回的data:
{"total":2,
"jsonarray":[{"doctorname":"李华","doctorage":31,"doctorgender":"男","doctorphone":"15534874562","doctoraddress":"洛阳市涧西区联盟路联盟小区"},
{"doctorname":"张忠","doctorage":32,"doctorgender":"男","doctorphone":"143514589563","doctoraddress":"洛阳市涧西区联盟路龙鳞小区"}]}
数据加载不出来,请问这样写不对吗?数据已经利用ajax返回呀,但是为什么是加载不上呢?我看咱们的api说data属性值为array类型的,我的数据也是对的额,但是为什么加载不出来呢?还有没有别的方式进行加载呢?
|
|