使用JQGrid的本地数据

时间:2012-10-01 19:42:16

标签: json jqgrid

我在JQGrid中使用了一些本地定义的JSON数据。我的数据如下: -

{"total_rows":1662,"offset":0,"rows":
    [
    {"id":"338b79f07dfe8b3877b3aa41a5205e75","key":"2004-03-05T03:59:00+00:00","value":             {"date":"2004-03-05T03:59:00+00:00","signature":"sig1","name":"name1"}},
    {"id":"338b79f07dfe8b3877b3aa41a540cf58","key":"2004-03-05T03:59:00+00:00","value": {"date":"2004-03-05T03:59:00+00:00","signature":"sig2","name":"name2"}},
    {"id":"338b79f07dfe8b3877b3aa41a566ca42","key":"2004-03-05T03:59:00+00:00","value": {"date":"2004-03-05T03:59:00+00:00","signature":"sig3","name":"name3"}},
    {"id":"15add79dd3efec4f34786d5f6a33ec5c","key":"2004-07-26T14:03:00+00:00","value"  :{"date":"2004-07-26T14:03:00+00:00","signature":"sig4","name":"name4"}}
    ] 
}

我的JQGrid定义如下所示:

 datatype: "local",
            height: 100,
            colNames:['key', 'signature', 'name'],
            colModel:[
                {name:'key',index:'key', width:80}
                {name:'value.signature',label:'Signature', width:100, align:"right"},
                {name:'value.name',index:'name', width:80}

            ],

            caption: "Load Once Example"

但是,value.signature和value.name字段的列始终为空。

任何指针都会非常感激!

1 个答案:

答案 0 :(得分:0)

好的 - 找到了这个here!

的答案

工作得很完美!