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
Pager not displaying pages and totals
19/10/2009
16:19
Avatar
erich93063
Member
Members
Forum Posts: 14
Member Since:
19/10/2009
sp_UserOfflineSmall Offline

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:

<script type=”text/javascript”>
$(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>

<table id=”list” class=”scroll” cellpadding=”0″ cellspacing=”0″></table>
<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}
19/10/2009
16:48
Avatar
jack_s
Member
Members
Forum Posts: 17
Member Since:
11/07/2009
sp_UserOfflineSmall Offline

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:

http://www.trirand.com/jqgridw.....wiki:pager

20/10/2009
11:28
Avatar
erich93063
Member
Members
Forum Posts: 14
Member Since:
19/10/2009
sp_UserOfflineSmall Offline

HMM I looked at the wiki and I'm doing exactly what it says to do. I would think just using

pager: $('#pager'),

should work and use the defaults for the pager. I did for what its worth try:

pager: $('#pager'),
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}

21/10/2009
05:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

21/10/2009
15:10
Avatar
erich93063
Member
Members
Forum Posts: 14
Member Since:
19/10/2009
sp_UserOfflineSmall Offline

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/redmond/jquery-ui-1.7.2.custom.css” />
<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}
21/10/2009
15:53
Avatar
erich93063
Member
Members
Forum Posts: 14
Member Since:
19/10/2009
sp_UserOfflineSmall Offline

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/redmond/jquery-ui-1.7.2.custom.css" />
<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:

<?xml version="1.0" encoding="UTF-8"?>
<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>

21/10/2009
16:37
Avatar
erich93063
Member
Members
Forum Posts: 14
Member Since:
19/10/2009
sp_UserOfflineSmall Offline

Ok well I got it to work with the following code. What I needed to do was to get rid of:

recordtext:'Total Records',
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

<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',              
                jsonReader: {
                    root: “ROWS”,
                    page: “PAGE”,
                    total: “TOTAL”,
                    records:”RECORDS”,
                    cell: “”,
                    id: “id”
                    }
                }
            );           
           
        }
    );
    </script>
26/06/2014
17:39
Avatar
edotom
Member
Members
Forum Posts: 5
Member Since:
23/05/2014
sp_UserOfflineSmall Offline

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

08/07/2014
11:23
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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