Forum


14:59

18/09/2009

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
07:20

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 🙂
09:23

18/09/2009

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
08:49

Moderators
30/10/2007

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.
21:56

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
02:26

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
03:32

Moderators
30/10/2007

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.
03:30

Moderators
30/10/2007

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.
16:44

<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!
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66