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
jsonReader issues
08/01/2009
09:29
Avatar
brycekmartin
Member
Members
Forum Posts: 22
Member Since:
08/01/2009
sp_UserOfflineSmall Offline

Hey Tony,

Long time man.  I love what you've been doing with the grid and I love what you have done with the site.

I've been looking at upgrading my grid to version 3.3 but I'm having some trouble.  When I run it I get an error.  Firebug tells me that it doesn't like  repeatitems:false  in the jsonReader part.

here is the code...

            $("#results").jqGrid({
                url: "SearchResults",
                datatype: "json",
                colNames: columnNames,
                colModel: columnModel,
                pager: jQuery('#pager2'),
                rowNum:20,
                rowList:null,
                imgpath:"images/images",
                sortname:'hord',
                viewrecords:true,
                sortorder:"desc",
                multiselect: true,
                width:gridwidth,
                height:'100%',
                onPaging: function(){
                    saveSelected(iterLimit, orderList);
                },
                loadComplete: function(){
                    $('#cb').prev().remove();
                    if($("#results").getGridParam("records")==0){
                        confirm("Error: no search results","Selection.jsp");
                    }
                    else
                    {   
                        var page = $('#results').getGridParam("page");
                        var records = $('#results').getGridParam("records");
                        var recordsPP = $('#results').getGridParam("RowNum");
                        var x = records/recordsPP;
                        var returnArray = [];
                        if(x < page)
                        {
                            iterLimit = records%recordsPP;
                        }
                        else
                        {
                            iterLimit = recordsPP;
                        }

                        for(var i=1; i<=iterLimit; i++)
                        {
                            $('#'+i).children('td:first').next().addClass('link');
                            var ord = $('#'+i).children('td:first').next().text();
                            returnArray = orderList.find(ord);
                            var truefalse = typeof returnArray;
                            if(truefalse != 'boolean')
                            {
                                $('#results').setSelection(i);
                            }
                            $('#'+i).children('td:first').next().click(function(){
                                ord = $(this).text();
                                window.location.href = "Recap?ord="+ord+"&pg="+page;
                            });
                        }
                    }
                },
                shrinkToFit: true,
                jsonReader: {root: "rows",
                    page: "page",
                    total: "total",
                    records: "records",
                    repeatitems : false
                }
            });   

It was working with 3.0, but with I put in the code for 3.3 it started having issues.  Also, I added the root, page, total, and records part since putting in 3.3 thinking maybe it needed them.  Nothing seems to help.

Thanks for any help.

Bryce

08/01/2009
10:08
Avatar
brycekmartin
Member
Members
Forum Posts: 22
Member Since:
08/01/2009
sp_UserOfflineSmall Offline

I have played with it a bit more and found that it just doesn't like the last parameter of the jsonReader option.  If i put id:"0" after repeatitems then it gives me an error on id:"0".  So I'm not sure what is wrong, the format looks good to me, but maybe I'm missing something.

08/01/2009
10:14
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I do not think that this is the problem.

Could you please post a part from data returned from the server?

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.

08/01/2009
10:31
Avatar
brycekmartin
Member
Members
Forum Posts: 22
Member Since:
08/01/2009
sp_UserOfflineSmall Offline

Its not getting to that point.  This is happening on the initial load of the page.

08/01/2009
10:39
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

If you remove the jsonReader from parameters what  is  happen?

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.

08/01/2009
10:56
Avatar
brycekmartin
Member
Members
Forum Posts: 22
Member Since:
08/01/2009
sp_UserOfflineSmall Offline

It just keeps rolling up to the next option.  If I remove that one, then i goes to the next and on and on.  Has the formatting of the grid options changed?

08/01/2009
13:15
Avatar
brycekmartin
Member
Members
Forum Posts: 22
Member Since:
08/01/2009
sp_UserOfflineSmall Offline

Do I have to manually include all of the modules for jqgrid?

I look at the code and I see the modules var, and I don't have any of them listed in my directory... maybe this is the problem?  Its acting like it doesn't even recognize jqGrid({}) as a valid function.

09/01/2009
08:16
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Glad to see thet this is the problem. Go in the documentation page to read what is needed to configure this.

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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