【发布时间】:2011-09-23 19:29:53
【问题描述】:
我有一个 jqgrid,我想用我的 json 填充它,但我无法让它工作。我认为我的 json 很好,因为在将 json 作为字符串(数据类型:jsonstring)提供时网格正在工作。问题是,我没有从 jqgrid 中得到任何错误,这使得调试变得困难。
这是我的 json(使用 jslint 验证):
{ "total":"1", "page":"1", "records":"5", "rows": [ {"id" :"1", "cell" :["Modulex", "", "", "", ""]}, {"id" :"2", "cell" :["Lemoltech", "", "", "", ""]}, {"id" :"3", "cell" :["Isothermic", "", "", "", ""]}, {"id" :"4", "cell" :["Renova", "", "", "", ""]}, {"id" :"5", "cell" :["Natart Juvenile", "", "", "", ""]} ] }
这是我的配置
$("#list").jqGrid({
url:'/tempajax/',
datatype: 'json',
colNames:['Nom','Adresse','Ville','Tel','Courriel'],
colModel :[
{name:'company_name', index:'company_name', width:55},
{name:'address', index:'address', width:90},
{name:'city', index:'city', width:90},
{name:'telephone', index:'telephone', width:80},
{name:'email', index:'email', width:80},
],
autowidth: true,
pager: '#pager',
rowNum:10,
viewrecords: true,
gridview: true,
height: '100%'
});
这是我在这里的第一篇文章,所以我希望提供足够的信息来帮助你们,如果不仅仅是问的话。
非常感谢您的帮助!
【问题讨论】: