本文介绍了jqgrid错误-b.jgrid.jqID不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to get started with the jQuery plugin, jqGrid, however it's giving me the error - "b.jgrid.jqID is not a function". I downloaded the plugin from http://www.trirand.com/blog/?page_id=6 with all features included and am referencing both jquery.jqGrid.min.js and grid.locale-en.js.

这是html:

<table id="list"></table>
<div id="pager"></div>

这是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 });

    });

推荐答案

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

Please try to include "i18n/grid.locale-en.js" before "jquery.jqGrid.src.js"

这篇关于jqgrid错误-b.jgrid.jqID不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 23:16