Home › Forums › Guriddo jqGrid JS › Help › format is undefined
Hello….
I have the code:
I have the same problem, but I found soulution for this. There is only one problem – my soulution is not good one….
at first, I use grid.base.js, not jquery.jqGrid.min.js
There is line like this (572):$(“.ui-paging-info”,ts.p.pager).html($.jgrid.format(ts.p.recordtext,from,to,tot));
This line is start of the problem. When format function is called ($.jgrid.format(ts.p.recordtext,from,to,tot)), the first argument – ts.p.recordtext –
thanks buddy………… this is a solution to the problem, because don't show the error…. but i think that there is better way for this problem…….. and… i don't know how.
Other things, is that i implemented your solution, and, when i push in >> (other page) the grid show me “undefined” y next hide this message.
thanks
Jorel
I found real one soulution – you must include grid.locale-en.js script in html header (or somewhere else). It works for me.
thanks, but, this don't change.
ok… These ar all included scripts in my project:
jquery.js
jquery-ui-1.7.1.custom.min.js
jquery.layout.js
grid.locale-en.js
jquery.jqGrid.min.js
jquery.tablednd.js
jquery.contextmenu.js
grid.base.js
grid.common.js
grid.formedit.js
Try to include all of them – may be it helps
Hello,
Just tested your code again with the data in my server and everthing work ok. Are you sure that this is the whole code?
Try to isolate the problem. All these in the last post are not needed.
Just look here and try only with jqGrid only without any othe plugin.
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:how_to_install
and here
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:first_grid
Regards
Tony
Hi,
I have the same problems.
check http://www.trirand.com/blog/?page_id=393/help/jgridformat-is-not-a-function/
tony said:
Post edited 04:44 – 04/09/2009 by tony
Hello,
Load the language file before the jqGrid in script tag. See installation.
Regards
Tony
So, I ran into this same problem and it's actually because of a bug that exists if you pass an undefined parameter into the format method …
Inside of grid.base.js, you'll see the format method on jgrid … if you add a check for an undefined value then it works.
format : function(format){ //jqgformat
var args = $.makeArray(arguments).slice(1);
if(format === undefined) format = “”; //Add this line and it's fixed
return format.replace(/\{(\d+)\}/g, function(m, i){
return args;
});
},
– Chris
Hello,
Thanks. Fixed.
Regards
Tony
tony said:
Hello,
Thanks. Fixed.
Regards
Tony
Uhm… I don't know where it's fixed…
I've downloaded the latest build and i've the same problem 😛
How can I fix it?
Hello,
It is fixed. You can see this in GitHUb and it is present in 3.6
1. Try to clear your cache.
2. If this continue – maybe you have bad grid configuaration. Also be a sure to load the lang file before the grid.
Regards
Tony
Excelent! Iinluding grid.locale-(cs).js fixed my problem: ” $.jgrid.formatter is undefined “
this is the correct include order… just do it!
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top