我使用的jqGrid與數據類型爲JSON和值從另一個URL取回後,排序不工作的jqGrid使用自定義格式
colModel: [
{ name: "Details", width: 200,classes: 'pointer wrap',sortable: false,
formatter: function myFormatter(cellvalue, options, rowObject){
number=rowObject.properties.number;
name= rowObject.properties.shortName;
fullDetails= '<strong> '+name+ '</strong> </br>[<a id="pointer" title="Click to search" href= http://google.com/search?search='+number+' target='+number+'>'+number+'</a>]';
return fullDetails;
}
},
{ name:"name",jsonmap: "properties.shortName", width: 200,classes: 'pointer wrap',hidden:true},
{name:"number", jsonmap: "properties.number", width: 50 ,sortable: true,hidden:true},
{ name:"date",jsonmap: "properties.date", width: 80,hidden :false}
],
pager: "#pager",
//rowNum: 20,
rowNum: 100,
rowList: [10, 20, 30],
sortname: "matter",
sortorder: 'asc',
viewrecords: true,
gridview: true,
loadonce : true,
autoencode: true,
height:'auto',
hidegrid: false,
caption: "Details",
jsonReader : {
repeatitems: false,
root: "properties"
}
加載工作正常 但是,單擊列標題後對它進行排序
TypeError:rowObject.properties未定義 number = rowObject.properties.number;顯示爲 可能會出現什麼問題? 有什麼可以解決的? 下面給出的是樣本數據
[
{"properties":
{"date":1409327760,"name":"agent M","number":"4117859","shortName":"AM"},"children":null,"valId":"225","objectType":"VAL"},
{"properties":
{"date":14093278860,"name":"agent x","number":"97893783","shortName":"AX"},"children":null,"valId":"191","objectType":"VAL"}
]
遺憾我錯過了 我對此感到 – 2014-09-18 17:29:03