jqgrid错误 - b.jgrid.jqID不是函数

Jus*_*tin 17 jquery jqgrid

我正在尝试开始使用jQuery插件jqGrid,但是它给了我错误 - "b.jgrid.jqID不是函数".我从http://www.trirand.com/blog/?page_id=6下载了包含所有功能的插件,并引用了jquery.jqGrid.min.js和grid.locale-en.js.

这是html:

<table id="list"></table>
<div id="pager"></div>
Run Code Online (Sandbox Code Playgroud)

这是js:

jQuery(function () {

        jQuery("#list").jqGrid({
            url: '/admin/campus/getnearbybusinesses',
            datatype: "json",
            colNames: ['Name', 'Location'],
            colModel: [
                { name: 'Name', index: 'Name', width: 150 },
                { name: 'Location', index: 'Location', width: 150 }
            ],
            rowNum: 10,
            rowList: [10, 20, 30],
            pager: '#pager',
            sortname: 'Name',
            viewrecords: true,
            sortorder: "asc",
            caption: "Businesses"
        });

        jQuery("#list").jqGrid('navGrid', '#pager', { edit: false, add: false, del: false });

    });
Run Code Online (Sandbox Code Playgroud)

小智 32

请尝试在"jquery.jqGrid.src.js"之前加入"i18n/grid.locale-en.js"

  • 我在答案前8天在评论中发布了答案,但我会给你积分.:) (3认同)