jqGrid添加行报错,错误信息: jQuery("#list4").jqGrid("addRowData",i+1,mydata[i]);
错误信息:TypeError:b.isEmptyObjectisnotafunction;数据:varmydata=[{id:"1",invdate:"2007-10-0...
错误信息:TypeError: b.isEmptyObject is not a function;
数据: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"}];求帮助,有问题接下来的工作没法开展,求大侠
html:<table id="list4"></table> 展开
数据: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"}];求帮助,有问题接下来的工作没法开展,求大侠
html:<table id="list4"></table> 展开
1个回答
展开全部
我随便试了一下,是可以的。。是不是你的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]);
}
追问
引入了那些js文件,能粘贴给我看吗,jquery你的多少版本?
追答
我引用的是jquery 1.9.2, jqgrid-4.4, jquery-ui-1.10.2
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询