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_TopicIcon
format is undefined
18/09/2009
14:59
Avatar
Jorel
Colombia
Member
Members
Forum Posts: 3
Member Since:
18/09/2009
sp_UserOfflineSmall Offline

Hello....

I have the code:

<script type="text/javascript">
            $(document).ready(function(){
              jQuery("#list").jqGrid({
                    url:'carga.jsp',
                    datatype: "json",
                    mtype:'GET',
                    colNames:['Inv No','Date', 'Name', 'Amount','Tax','Total','Notes'],
                    colModel:[
                        {name:'invid',index:'invid', width:55},
                        {name:'invdate',index:'invdate', width:90},
                        {name:'name',index:'name asc, invdate', width:100},
                        {name:'amount',index:'amount', width:80, align:"right"},
                        {name:'tax',index:'tax', width:80, align:"right"},
                        {name:'total',index:'total', width:80,align:"right"},
                        {name:'note',index:'note', width:150, sortable:false} ],
                    pager:jQuery("#pager"),
                    rowNum:10,
                    rowList:[10,20,30],
                    sortname: 'id',
                    sortorder: "desc",
                    viewrecords: true,
                    imgpath:'resources/css/themes/basic/images',
                    caption:"Mi primera grilla"
                });

            });
        </script>

i the response is:

{'page':'1','total':2,'records':'13','rows':[{'id':'13','cell':['13','2007-10-06','Client 3','1000.00','0.00','1000.00',null]},{'id':'12','cell':['12','2007-10-06','Client 2','700.00','140.00','840.00',null]},{'id':'11','cell':['11','2007-10-06','Client 1','600.00','120.00','720.00',null]},{'id':'10','cell':['10','2007-10-06','Client 2','100.00','20.00','120.00',null]},{'id':'9','cell':['9','2007-10-06','Client 1','200.00','40.00','240.00',null]},{'id':'8','cell':['8','2007-10-06','Client 3','200.00','0.00','200.00',null]},{'id':'7','cell':['7','2007-10-05','Client 2','120.00','12.00','134.00',null]},{'id':'6','cell':['6','2007-10-05','Client 1','50.00','10.00','60.00',null]},{'id':'5','cell':['5','2007-10-05','Client 3','100.00','0.00','100.00','no tax']},{'id':'4','cell':['4','2007-10-04','Client 3','150.00','0.00','150.00','no tax']}],'userdata':{'amount':3220,'tax':342,'total':3564,'name':'Totals:'}}

But the error is: format is undefined, and i don't know the cause.

Thanks,

Jorel

19/09/2009
07:20
Avatar
Blekss
Guest
Guests

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 -  is undefined. I didn't find any place in the code where recordtext is used or defined. when I delete this line my jqgrid works whithout any errors. It is possible that this soulution my couse other errors, but i didn't find any error at the moment

Sorry for may language skills - it's quite bad.... I houp you understand mee 🙂

19/09/2009
09:23
Avatar
Jorel
Colombia
Member
Members
Forum Posts: 3
Member Since:
18/09/2009
sp_UserOfflineSmall Offline

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

19/09/2009
10:11
Avatar
Blekss
Guest
Guests

I found real one soulution – you must include grid.locale-en.js script in html header (or somewhere else). It works for me.

19/09/2009
10:39
Avatar
Jorel
Colombia
Member
Members
Forum Posts: 3
Member Since:
18/09/2009
sp_UserOfflineSmall Offline

thanks, but, this don't change.

19/09/2009
11:56
Avatar
Blekss
Guest
Guests

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

21/09/2009
08:49
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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/jqgridw.....to_install

and here

http://www.trirand.com/jqgridw.....first_grid

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

24/09/2009
21:08
Avatar
springgrass
Guest
Guests

Hi,

I have the same problems.  I guess it might have to do with the minified version, perhaps it doesn't load all dependent javascript file in this file?

Thanks

10/10/2009
21:56
Avatar
snssswc
Guest
Guests

check http://www.trirand.com/blog/?p.....-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

24/10/2009
02:26
Avatar
yodasan
Guest
Guests

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[i];

});

},

- Chris

27/10/2009
03:32
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Thanks. Fixed.

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

10/11/2009
13:07
Avatar
StErMi
Member
Members
Forum Posts: 3
Member Since:
10/11/2009
sp_UserOfflineSmall Offline

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?

11/11/2009
03:30
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

18/11/2009
08:58
Avatar
neph04
Guest
Guests

Excelent! Iinluding grid.locale-(cs).js fixed my problem: " $.jgrid.formatter is undefined "

20/12/2009
16:44
Avatar
Mathias Grimm
Guest
Guests

<link rel="stylesheet" type="text/css" media="screen" href="/js/jgrid/css/ui.jqgrid.css" />

<script type="text/javascript" src="/js/jgrid/js/i18n/grid.locale-pt-br.js"></script>
<script type="text/javascript" src="/js/jgrid/js/jquery.jqGrid.min.js"></script>

this is the correct include order... just do it!

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
59 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