我随便试了一下,是可以的。。是不是你的jquery版本太旧了。
jQuery("#list4").jqGrid({datatype: "local",
height: 'auto',
width:'100%',
colNames:['id','invdate','name','note','amount','tax','total'],
colModel:[
{name:'id',index:'id', sortable:false},
{name:'invdate',index:'invdate', width:60},
{name:'name',index:'name', width:130},
{name:'note',index:'note', width:130},
{name:'amount',index:'amount', width:92},
{name:'tax',index:'tax', width:92},
{name:'total',index:'total', width:130}],
sortname: 'id', viewrecords: true, sortorder: "asc",
multiselect: true,
onCellSelect: function(rowid,iCol,cellcontent,e) {
}
})
var mydata = [
{id:"1",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"2",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}]
for(var i=0 i <= mydata.length i++){
jQuery("#list4").jqGrid('addRowData',i+1,mydata[i])
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)