simple jqGrid implementation doesn't work
$("#list2").jqGrid({
mtype: 'GET',
datatype: 'Arche.Search.ItemT',
colNames:['test1','test2', 'test3'],
colModel:[
{name:'ID',index:'ID', width:100,align:"center",key:true},
{name:'Brand',index:'Name', width:90},
开发者_高级运维 {name:'BrandID',index:'CurrentPrice asc, invdate', width:100},
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager2',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"TEST jqGRID",
multiselect: false
});
var datarow = {ID:"99",Brand:"2007-09-01",BrandID:"test3"};
//$("#list2").addRowData(0,datarow); <== this works very well.
$("#list2")[0].addJSONData("{total: 1, page: 1, records: 1, rows : [ {id: '1', cell:['1', '2007-10-01', 'test']} ] }");
the code
$("#list2")[0].addJSONData("{total: 1, page: 1, records: 1, rows : [ {id: '1', cell:['1', '2007-10-01', 'test']} ] }");
doesn't show anything upon the jqGrid.
and also doesn't have an error.
I really can't find the reason why this doens't work..
and I have 1more question.
the question is JSON.parse() is grammertical error in my case.
Apparently there are issues with addJSONData: jqgrid-addjsondata-asp-net-2-0-ws
Are you sure that addRowData
is not an option for you?
精彩评论