Forum
16:19
19/10/2009
K I'm going crazy over here. I finally got my grid working using ColdFusion. The grid displays, will sort and the pagination works BUT, the pages in the pager and the total records found will not display in the pager. So where it is supposed to say “1 of 400″, it jsut says “of” and instead of “Total Records: 4000″, it just says “Total Records”. The previous/next buttons display and if i click them they work and actually paginate the records, its just missing the page totals and record totals. Here is my code:
$(document).ready(function()
{
$(”#list”).jqGrid(
{
url:'Users.cfc?method=getUsers',
datatype: 'json',
colNames:['CandidateID','FirstName','LastName', 'Email'],
colModel :[
{name:'CandidateID',index:'CandidateID', width:150, sorttype:"int"},
{name:'FirstName',index:'FirstName', width:150, sorttype:"string"},
{name:'LastName',index:'LastName', width:150, sorttype:"string"},
{name:'Email',index:'Email', width:150, sorttype:"string"}
],
pager: $('#pager'),
rowNum:10,
rowList:[10,20,50,100],
sortorder: “asc”,
sortname: “CandidateID”,
viewrecords: true,
caption: 'Users',
height:'auto',
recordtext:'Total Records',
pgtext:'of',
jsonReader: {
root: “ROWS”,
page: “PAGE”,
total: “TOTAL”,
records:”RECORDS”,
cell: “”,
id: “id”
}
}
);
}
);
</script>
<div id=”pager”></div>
Here is a sample response from firebug:
{"ROWS":[[609264,"Duncan","Cottrell","duncancottrell@yahoo.com"],[609265,"Colletta","Brabham-orr","collettaorr
@hotmail.com"],[609266,"Aaron","Bryan","AaBryan@Gmail.com"],[609267,"Millicent","Williams","millicentwllms
@yahoo.com"],[609268,"Liang","Chen","lchen@tulane.edu"],[609269,"Sylvia","Marquez","bushqui@fastmail
.com"],[609270,"Minu","Sinha","minu.varan@gmail.com"],[609271,"Tejas","Kadakia","rajk234@hotmail.com"
],[609272,"Elisa","Person","elisaperson@sbcglobal.net"],[609273,"Mustafa","Yaman","mustafayaman1977@yahoo
.com"]],"PAGE":1.0,"TOTAL":400.0,"RECORDS":4000}
hi, that drove me crazy too - you are probably looking at some out of date docs (assuming you're using the latest release).
Go here to new docs and it is easily fixed:
11:28
19/10/2009
HMM I looked at the wiki and I'm doing exactly what it says to do. I would think just using
should work and use the defaults for the pager. I did for what its worth try:
recordtext: "View {0} - {1} of {2}",
emptyrecords: "No records to view",
pgtext : "Page {0} of {1}",
but that didnt work either. The pager works as far as clicking ont the prev/next buttons and it actually paging, it's just missing the page counts and the total on the pager. They are blank, even though those values are being passed in the JSON. Maybe my JSOn is incorrect?
{"ROWS":[[609264,"Duncan","Cottrell","duncancottrell@yahoo.com"],[609265,"Colletta","Brabham-orr","collettaorr
@hotmail.com"],[609266,"Aaron","Bryan","AaBryan@Gmail.com"],[609267,"Millicent","Williams","millicentwllms
@yahoo.com"],[609268,"Liang","Chen","lchen@tulane.edu"],[609269,"Sylvia","Marquez","bushqui@fastmail
.com"],[609270,"Minu","Sinha","minu.varan@gmail.com"],[609271,"Tejas","Kadakia","rajk234@hotmail.com"
],[609272,"Elisa","Person","elisaperson@sbcglobal.net"],[609273,"Mustafa","Yaman","mustafayaman1977@yahoo
.com"]],"PAGE":1.0,"TOTAL":400.0,"RECORDS":4000}
05:08
Moderators
30/10/2007
Hello,
Be a sure that you have a pginput set to true. Also could you please to provide integers instead of floats in the request.
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.
15:10
19/10/2009
HMM Still not working. Here is what im using right now. Is my JSON not correct or something? Like I said, the grid loads and sorts and paginates. It's just missing the page counts and total. So frustrating. I'm so close.:
<link rel=”stylesheet” type=”text/css” media=”screen” href=”css/ui.jqgrid.css” />
<script src=”js/jquery-1.3.2.min.js” type=”text/javascript”></script>
<script src=”js/i18n/grid.locale-en.js” type=”text/javascript”></script>
<script src=”js/jquery.jqGrid.min.js” type=”text/javascript”></script>
<script type=”text/javascript”>
$(document).ready(function()
{
$(”#list”).jqGrid(
{
url:'Users.cfc?method=getUsers',
datatype: 'json',
colNames:['CandidateID','FirstName','LastName'],
colModel :[
{name:'CandidateID',index:'CandidateID', width:150, sorttype:"int"},
{name:'FirstName',index:'FirstName', width:150, sorttype:"string"},
{name:'LastName',index:'LastName', width:150, sorttype:"string"}
],
pager: $('#pager'),
pginput: “true”,
rowNum:10,
rowList:[10,20,50,100],
sortorder: “asc”,
sortname: “CandidateID”,
viewrecords: true,
caption: 'Users',
height:'auto',
recordtext:'Total Records',
pgtext:'of',
jsonReader: {
root: “ROWS”,
page: “PAGE”,
total: “TOTAL”,
records:”RECORDS”,
cell: “”,
id: “id”
}
}
);
}
);
</script>
<table id=”list”></table>
<div id=”pager”></div>
JSON:
{"ROWS":[[609264,"Duncan","Cottrell"],[609265,"Colletta","Brabham-orr"],[609266,"Aaron","Bryan"],[609267
,"Millicent","Williams"],[609268,"Liang","Chen"],[609269,"Sylvia","Marquez"],[609270,"Minu","Sinha"]
,[609271,"Tejas","Kadakia"],[609272,"Elisa","Person"],[609273,"Mustafa","Yaman"]],"PAGE":1,"TOTAL":400
,"RECORDS":4000}
15:53
19/10/2009
I also just tried switchin it to XML and I'm getting the same thing. No page counts and no totals.
Code:
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#list").jqGrid(
{
url:'test.xml',
datatype: 'xml',
colNames:['CandidateID','FirstName','LastName'],
colModel :[
{name:'CandidateID',index:'CandidateID', width:150, sorttype:"int"},
{name:'FirstName',index:'FirstName', width:150, sorttype:"string"},
{name:'LastName',index:'LastName', width:150, sorttype:"string"}
],
pager: $('#pager'),
pginput: "true",
rowNum:10,
rowList:[10,20,50,100],
sortorder: "asc",
sortname: "CandidateID",
viewrecords: true,
caption: 'Users',
height:'auto',
recordtext:'Total Records',
pgtext:'of'
}
);
}
);
</script>
</head>
<body>
<table id="list"></table>
<div id="pager"></div>
XML:
<rows>
<page>1</page>
<total>400</total>
<records>4000</records>
<row>
<cell>609264</cell>
<cell>Duncan</cell>
<cell>Cottrell</cell>
</row>
<row>
<cell>609265</cell>
<cell>Colletta</cell>
<cell>Brabham-orr</cell>
</row>
<row>
<cell>609266</cell>
<cell>Aaron</cell>
<cell>Bryan</cell>
</row>
<row>
<cell>609267</cell>
<cell>Millicent</cell>
<cell>Williams</cell>
</row>
<row>
<cell>609268</cell>
<cell>Liang</cell>
<cell>Chen</cell>
</row>
<row>
<cell>609269</cell>
<cell>Sylvia</cell>
<cell>Marquez</cell>
</row>
<row>
<cell>609270</cell>
<cell>Minu</cell>
<cell>Sinha</cell>
</row>
<row>
<cell>609271</cell>
<cell>Tejas</cell>
<cell>Kadakia</cell>
</row>
<row>
<cell>609272</cell>
<cell>Elisa</cell>
<cell>Person</cell>
</row>
<row>
<cell>609273</cell>
<cell>Mustafa</cell>
<cell>Yaman</cell>
</row>
</rows>
16:37
19/10/2009
Ok well I got it to work with the following code. What I needed to do was to get rid of:
pgtext:'of',
If you use those, you need to reference {0}, {1} and {2} in those values. Since i wasnt doing that, the numbers were blank.
This is what worked
$(document).ready(function()
{
$(”#list”).jqGrid(
{
url:'Users.cfc?method=getUsers',
datatype: 'json',
colNames:['CandidateID','FirstName','LastName'],
colModel :[
{name:'CandidateID',index:'CandidateID', width:150, sorttype:"int"},
{name:'FirstName',index:'FirstName', width:150, sorttype:"string"},
{name:'LastName',index:'LastName', width:150, sorttype:"string"}
],
pager: $('#pager'),
pginput: true,
rowNum:10,
rowList:[10,20,50,100],
sortorder: “asc”,
sortname: “CandidateID”,
viewrecords: true,
caption: 'Users',
height:'auto',
jsonReader: {
root: “ROWS”,
page: “PAGE”,
total: “TOTAL”,
records:”RECORDS”,
cell: “”,
id: “id”
}
}
);
}
);
</script>
17:39
23/05/2014
I had a similar problem recently, my pager showed all buttons but navigation ones.  My jqgrid had only three fields.  After going nuts for a couple of days and changing everything several times, I found that jqgrid needs to have at least a minimum width to show all buttons.  Apparently a number between 600 and 800 is good. It worked for me but I couldn´t find on documentation if there is a minimum width for grid or if pager can have a width on it.  I would like to have a word of advice from trirand support.
Â
regards
Â
edgar
11:23
Moderators
30/10/2007
Hello,
I think that the problem is in css setting and the style shhets.
Try with very basic setting and jqgrid only to see that everthing is fine.
Kind Regards
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.
Most Users Ever Online: 715
Currently Online:
41 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