0x800a01b6 - 微软JScript运行时错误:对象不支持属性或方法“的jqGrid” [英] 0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'jqGrid'

查看:3534
本文介绍了0x800a01b6 - 微软JScript运行时错误:对象不支持属性或方法“的jqGrid”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <脚本类型=文/ JavaScript的>$(文件)。就绪(函数(){    $(#list1的)。jqGrid的({
        数据类型:本地,
        colNames:['INV否,日期,客户,金额,税收,合计,注意]
        colModel:
                       {名称:'身份证',索引:'ID',宽度:60,sorttype:INT},
                       {名称:'invdate',索引:invdate',宽度:90,sorttype:日期},
                       {名称:'名',索引:'名',宽度:100},
                       {名称:'量',索引:'量',宽度:80,调整:右,sorttype:浮动},
                       {名称:'税',索引:'税',宽度:80,调整:右,sorttype:浮动},
                       {名称:'总',索引:'总',宽度:80,调整:右,sorttype:浮动},
                       {名称:'音符',索引:'注意',宽度:150,排序:假}
        ]
        多选:真实,
        的rowNum:10,
        rowList:[5,10,20,50,100],
        寻呼机:$('#pager1'),
        排序顺序:递减,
        viewrecords:真实,
        亚格子:真,
        subGridUrl:'Default.aspx的',
        subGridModel:[{
            名称:[否,项目,数量,单元,线otal'],
            宽度:[55,200,80,80,80]
        }
        ]
        标题:操控阵列数据
    });
    $(#list1的)的jqGrid('navGrid','#pager1',{德尔:假的,加:假的,编辑:假},{},{},{},{multipleSearch:真})。
    VAR MYDATA = [
               {ID:1,invdate:2007-10-01,名称:测试,注意:注意,金额:200.00,税10.00,总:210.00},
               {ID:2,invdate:2007-10-02,名称:测试2,注:注2,金额:300.00,税20.00,总:320.00},
               {ID:3,invdate:2007-09-01,名称:TEST3注:注3,金额:400.00,税30.00,总:430.00},
               {ID:4,invdate:2007-10-04,名称:测试,注意:注意,金额:200.00,税10.00,总:210.00},
               {ID:5,invdate:2007-10-05,名称:测试2,注:注2,金额:300.00,税20.00,总:320.00},
               {ID:6,invdate:2007-09-06,名称:TEST3注:注3,金额:400.00,税30.00,总:430.00},
               {ID:7,invdate:2007-10-04,名称:测试,注意:注意,金额:200.00,税10.00,总:210.00},
               {ID:8,invdate:2007-10-03,名称:测试2,注:注2,金额:300.00,税20.00,总:320.00},
               {ID:9,invdate:2007-09-01,名称:TEST3注:注3,金额:400.00,税30.00,总:430.00}
    ];
    对于(VAR I = 0;我LT&= mydata.length;我++)
        $(#list1的)的jqGrid('addRowData',我+ 1,MYDATA [I])。
    VAR lastsel2
    $(#rowed5)。jqGrid的({
        数据类型:本地,
        高度:250,
        colNames:身份证号码,姓名,股票,通过船舶','注意事项'],
        colModel:
               {名称:'身份证',索引:'ID',宽度:90,sorttype:INT,可编辑:真正},
               {名称:'名',索引:'名',宽度:150,可编辑:真正的,editoptions:{大小:20,最大长度:30}},
               {名称:'股票',指数:'股票',宽度:60,编辑:真的,edittype:复选框,editoptions:{值:是:否}},
               {名称:'船',索引:'船',宽度:90,编辑:真的,edittype:选择,editoptions:{值:FE:联邦快递; IN:银泰; TN:TNT; AR:ARAMEX} },
               {名称:'音符',索引:'注意',宽度:200,排序:假的,可编辑:真正的,edittype:文本区域,editoptions:{行:2,COLS:10}}
        ]
        多选:真实,
        的rowNum:10,
        rowList:[5,10,20,50,100],
        寻呼机:$('#pager2'),
        排序顺序:ASC
        viewrecords:真实,
        onSelectRow:功能(ID){
            如果(ID&安培;&安培;!ID == lastsel2){
                $('#rowed5')的jqGrid('restoreRow',lastsel2)。
                $('#rowed5')的jqGrid('editRow,ID,真实)。
                lastsel2 = ID;
            }
        },
        editurl:server.php
        标题:输入类型
    });
    $(#rowed5)的jqGrid('navGrid','#pager2',{德尔:假的,加:假的,编辑:假},{},{},{},{multipleSearch:真})。
    VAR mydata2 = [
               {ID:12345,名称:台式机,注意:注意,股票:是,船舶:联邦快递},
               {ID:23456,名称:笔记本电脑,注:龙文,股票:是,船舶:银泰},
               {ID:34567,名称:液晶显示器,注:注3,股票:是,船舶:TNT},
               {ID:45678,名称:扬声器,注意:注意,证券:否,舰:ARAMEX},
               {ID:56789,名称:激光打印机注:注2,股票:是,船舶:联邦快递},
               {ID:67890,名称:游戏站,注:注3,证券:否,舰:联邦快递},
               {ID:76543,名称:移动电话,注意:注意,股票:是,船舶:ARAMEX},
               {ID:87654,名称:服务器,注:注2,股票:是,船舶:TNT},
               {ID:98765,名称:针式打印机注:注3,证券:否,舰:联邦快递}
    ];
    对于(VAR I = 0; I< mydata2.length;我++)
        $(#rowed5)的jqGrid('addRowData',mydata2 [I] .ID,mydata2 [I])。
});
< / SCRIPT>


解决方案

请确保您已在您的网页这些文件: -

 <脚本SRC =〜/脚本/ jQuery的-1.11.0.min.js>< / SCRIPT>
<脚本SRC =〜/脚本/ jquery.jqGrid.min.js>< / SCRIPT>

请确保您使用的是应与jqGrid的版本,以及这些文件将被放置应该是相同的,如上图所示,首先包括jQuery的文件,然后jqGrid的文件中的顺序兼容Jquery的版本。

<script type="text/javascript">

$(document).ready(function () {

    $("#list1").jqGrid({
        datatype: "local",
        colNames: ['Inv No', '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 }
        ],
        multiselect: true,
        rowNum: 10,
        rowList: [5, 10, 20, 50, 100],
        pager: $('#pager1'),
        sortorder: "desc",
        viewrecords: true,
        subGrid: true,
        subGridUrl: 'Default.aspx',
        subGridModel: [{
            name: ['No', 'Item', 'Qty', 'Unit', 'Line otal'],
            width: [55, 200, 80, 80, 80]
        }
        ],
        caption: "Manipulating Array Data"
    });
    $("#list1").jqGrid('navGrid', '#pager1', { del: false, add: false, edit: false }, {}, {}, {}, { multipleSearch: true });
    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" },
               { id: "3", invdate: "2007-09-01", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: "430.00" },
               { id: "4", invdate: "2007-10-04", name: "test", note: "note", amount: "200.00", tax: "10.00", total: "210.00" },
               { id: "5", invdate: "2007-10-05", name: "test2", note: "note2", amount: "300.00", tax: "20.00", total: "320.00" },
               { id: "6", invdate: "2007-09-06", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: "430.00" },
               { id: "7", invdate: "2007-10-04", name: "test", note: "note", amount: "200.00", tax: "10.00", total: "210.00" },
               { id: "8", invdate: "2007-10-03", name: "test2", note: "note2", amount: "300.00", tax: "20.00", total: "320.00" },
               { id: "9", invdate: "2007-09-01", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: "430.00" }
    ];
    for (var i = 0; i <= mydata.length; i++)
        $("#list1").jqGrid('addRowData', i + 1, mydata[i]);
    var lastsel2
    $("#rowed5").jqGrid({
        datatype: "local",
        height: 250,
        colNames: ['ID Number', 'Name', 'Stock', 'Ship via', 'Notes'],
        colModel: [
               { name: 'id', index: 'id', width: 90, sorttype: "int", editable: true },
               { name: 'name', index: 'name', width: 150, editable: true, editoptions: { size: "20", maxlength: "30" } },
               { name: 'stock', index: 'stock', width: 60, editable: true, edittype: "checkbox", editoptions: { value: "Yes:No" } },
               { name: 'ship', index: 'ship', width: 90, editable: true, edittype: "select", editoptions: { value: "FE:FedEx;IN:InTime;TN:TNT;AR:ARAMEX" } },
               { name: 'note', index: 'note', width: 200, sortable: false, editable: true, edittype: "textarea", editoptions: { rows: "2", cols: "10" } }
        ],
        multiselect: true,
        rowNum: 10,
        rowList: [5, 10, 20, 50, 100],
        pager: $('#pager2'),
        sortorder: "asc",
        viewrecords: true,
        onSelectRow: function (id) {
            if (id && id !== lastsel2) {
                $('#rowed5').jqGrid('restoreRow', lastsel2);
                $('#rowed5').jqGrid('editRow', id, true);
                lastsel2 = id;
            }
        },
        editurl: "server.php",
        caption: "Input Types"
    });
    $("#rowed5").jqGrid('navGrid', '#pager2', { del: false, add: false, edit: false }, {}, {}, {}, { multipleSearch: true });
    var mydata2 = [
               { id: "12345", name: "Desktop Computer", note: "note", stock: "Yes", ship: "FedEx" },
               { id: "23456", name: "Laptop", note: "Long text ", stock: "Yes", ship: "InTime" },
               { id: "34567", name: "LCD Monitor", note: "note3", stock: "Yes", ship: "TNT" },
               { id: "45678", name: "Speakers", note: "note", stock: "No", ship: "ARAMEX" },
               { id: "56789", name: "Laser Printer", note: "note2", stock: "Yes", ship: "FedEx" },
               { id: "67890", name: "Play Station", note: "note3", stock: "No", ship: "FedEx" },
               { id: "76543", name: "Mobile Telephone", note: "note", stock: "Yes", ship: "ARAMEX" },
               { id: "87654", name: "Server", note: "note2", stock: "Yes", ship: "TNT" },
               { id: "98765", name: "Matrix Printer", note: "note3", stock: "No", ship: "FedEx" }
    ];
    for (var i = 0; i < mydata2.length; i++)
        $("#rowed5").jqGrid('addRowData', mydata2[i].id, mydata2[i]);
});
</script>

解决方案

Make sure you have included these files in your page :-

<script src="~/Scripts/jquery-1.11.0.min.js"></script>
<script src="~/Scripts/jquery.jqGrid.min.js"></script>

Make sure the Jquery version you are using should be compatible with jqGrid version and the order in which these files will be placed should be the same as shown above,first include Jquery file and then jqGrid file.

这篇关于0x800a01b6 - 微软JScript运行时错误:对象不支持属性或方法“的jqGrid”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆