Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
uncaught exception: jqGrid - No such method: navGrid
26/03/2011
02:56
Avatar
tadams
Beijing, China
Member
Members
Forum Posts: 5
Member Since:
26/03/2011
sp_UserOfflineSmall Offline

I get an uncaught exception: jqGrid - No such method: navGrid, when trying to enable the search button

on the navigation pager. Here my code :

var deleteLink ="/blog/delete/";
var editLink ="/blog/edit/";
jQuery.extend(jQuery.jgrid.defaults, { altRows:true, hoverrows: false });

function OnGridLoadComplete () {
    jQuery(".editLink").button({
        icons : {primary : 'ui-icon-pencil'},
        text : false
    });

     jQuery(".deleteLink").button({
         icons : {primary : 'ui-icon-trash'},
         text : false
     });

     jQuery(".editLink").click(function (){
          var id = jQuery(this).attr("id").split("_")[1];
         document.location.href= editLink + id + ".do";
     });

     jQuery(".deleteLink").click(function (){
         var id = jQuery(this).attr("id").split("_")[1];
          document.location.href= editLink + id + ".do";
     });
}

jQuery(document).ready(function(){
    jQuery("#blog_list").jqGrid({url : '/blog/page/ajax/get.do', datatype : 'json', mtype : 'get',
            colNames : ['Id', 'Comment', 'Date', 'User', 'Status', 'Edit', 'Delete'],
            colModel : [{name : 'id', index : 'id', width : 30, align : 'right', sortable : true, resizable : true, search : true},
                        {name : 'text', index : 'text', width : 300, align : 'left', sortable : true, resizable : true, search : true},
                        {name : 'date', index : 'date', width : 80, align : 'right', sortable : true, resizable : true, search : true},
                        {name : 'user', index : 'user', width : 150, align : 'left', sortable : true, resizable : true, search : true},
                        {name : 'status', index : 'status', width : 150, align : 'left', sortable : true, resizable : true, search : true},
                        {name : 'editLink', index : 'editLink', width : 80, align : 'center', sortable : true, resizable : true, search : false},
                        {name : 'deleteLink', index : 'deleteLink', width : 80, align : 'center', sortable : true, resizable : true, search : false}
                    ],
            pager : '#blog_pager',
            rowNum : 10,
            rowList : [10, 20, 30],
            sortname : 'id',
            sortorder : 'asc',
            viewrecords : true,
            caption : 'Blog list',
            loadComplete : OnGridLoadComplete}).jqGrid('navGrid',
                 '#blog_pager',{edit:true,add:true,del:true,search:true},
                 {}, // use default settings for edit
                 {}, // use default settings for add
                 {}, // delete instead that del:false we need this
                 {multipleSearch : true}, // enable the advanced searching
                 {closeOnEscape:true} // allow the view dialog to be closed when user press ESC key
            );
    jQuery("#blog_list").jqGrid("filterToolbar", {"autosearch":true,"stringResult":true});
});

Whatever i do, i always end with the error that the navGrid methods does not exist, also:

jQuery("#blog_List").jgGrid(....).navGrid(....);

ends up in the same error.

Used browser : Firefox version : 3.6.16, Opera 11.01, Safari 5.0.3

In Opera i got following error console output:

JavaScript - http://localhost:8080/blog/list.do

throw"jqGrid - No such method: "+f;

called from line 32, column 5 in <anonymous function>() in http://localhost:8080/blog/list.do:

a.call(s,c);

called via Function.prototype.call() from line 33, column 235 in <anonymous function: L>() in http://localhost:8080/common/js/jquery-1.4.2.min.js:

c.ready()

Any ideas what#s maybe wrong here?

C. Thomas

26/03/2011
12:25
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Thomas,

such error has typically one from two reasons: 1) you downloaded jqGrid without including "form editing" module (see jqGrid download page) 2) you use wrong order of JavaScript files inserted in the page. To verify the first one probelm you can open jquery.jqGrid.min.js file in the text editor and search in the comment at the beginning of the file for grid.formedit.js after the text "Modules:". In all cases the error is probably not in the part which you posted, but in for example the HTML code which shown the order of files included.

Best regards
Oleg

28/03/2011
10:02
Avatar
tadams
Beijing, China
Member
Members
Forum Posts: 5
Member Since:
26/03/2011
sp_UserOfflineSmall Offline

Hi Tony,

yes you were right, the corresponding formedit module was missing, stupid me.

Thanks a lot.

c. Thomas

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
29 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information