jqgrid error - b.jgrid.jqID is not a function
Asked Answered
J

2

17

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.

Here is the html:

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

And here is the 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 });

    });
Jordain answered 11/5, 2011 at 21:3 Comment(2)
Issue ending up being that I had referenced jqgrid .js first when grid.locale-en.js needs to be referenced first.Jordain
You're my hero. I've been working this issue for two hours thinking I had an error in my script.Cumulostratus
W
32

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

Wenz answered 19/5, 2011 at 7:43 Comment(2)
I posted the answer in my comment 8 days before this answer but I'll give you the points. :)Jordain
This also helps for error object has no method jqID. Just put it here for Google. Thanks!Sulfanilamide
D
0

I have the same problem, so first thing you need to consider is order of the included scripts (ex. first you need to load jquery, then grid.locale, and the last jqgrid.min.js), second thing to be considered is multiple included javascripts(in my project this was the problem, i have included jqgrid in two places). I removed them all and kept, only 1 version and the code started working file.

Digitalism answered 24/10, 2015 at 19:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.