【发布时间】:2011-08-30 16:32:33
【问题描述】:
我遇到了一个无法解决的问题。
请先看看这张图片
如您所见,我已经能够从服务器请求 JSON 数据。寻呼机显示有 4 条记录。但是记录没有显示在表格中。
这是我的 javascript 代码
jQuery("#pickFlex66").jqGrid({
url: root + '<?=$mod?>' + '/listpicker',
datatype: "json",
altRows: true,
mtype: 'POST',
colNames:['Code','Company Name'],
colModel:[
{name:'company_code',index:'company_code', width:100},
{name:'company_name',index:'company_name', width:100}
],
rowNum:10,
width: 540,
height: 310,
rowList:[10,20,30],
pager: '#pagerFlex66',
sortname: 'company_code',
shrinkToFit: false,
viewrecords: true,
sortorder: "desc",
caption:"<?=lang("users_title")?>",
onSelectRow: function(id){
}
});
jQuery("#pickFlex66").jqGrid('navGrid','#pagerFlex66',{edit:false,add:false,del:false,search:false});
这是我的 JSON 数据
{
"page": "1",
"total": 0,
"records": "4",
"rows": [{"id":"5","cell":["55-123","123"]},{"id":"3","cell":["123","IBM"]},{"id":"2","cell":["00000","BDO"]},{"id":"1","cell":["000-00","IT GROUP Inc "]}]
}
我的 javascript 有错误吗?或者可能在我的 JSON 数据中?
【问题讨论】:
标签: javascript jquery json jqgrid