在安装jqGrid的时候遇到了“对象不支持此属性或方法”错误,页面上什么都不显示,报错行一般为:
$("#list4").jqGrid({
url:'',
datatype: "local",
height: 250,
colNames:['InvNo','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:60, sorttype:"int"},
{name:'invdate',index:'invdate', width:90, sorttype:"date"},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right",sorttype:"float"},
{name:'tax',index:'tax', width:80, align:"right",sorttype:"float"},
{name:'total',index:'total', width:80,align:"right",sorttype:"float"},
{name:'note',index:'note', width:150, sortable:false}
],
rownumbers:true,
caption: "Manipulating Array Data"
});
原因如下:
1)原因一:
jqGrid插件引入路径不正确,加载不到文件所以不识别
即<script type="text/javascript" src="../js/jqGrid/js/jquery.jqGrid.min.js"></script>的src找不到你要引入的文件
2)引用 jquery.jqGrid.js的童鞋们,据说以下问题也会导致这个错误(本人没有试啊):
function jqGridInclude()
{
var pathtojsfiles = "js/"; // need to be ajusted
// set include to false if you do not want some modules to be included
var combineIntoOne = false;
......
pathtojsfiles 这个路径没配置对!!
{
var pathtojsfiles = "js/"; // need to be ajusted
// set include to false if you do not want some modules to be included
var combineIntoOne = false;
......
pathtojsfiles 这个路径没配置对!!
另外,有人说 jqGrid中没有该某个属性时也会报这个错误,经尝试后貌似不会啊!